fede-vaccaro / TerrainEngine-OpenGL

An OpenGL 4 and C++ program which renders a procedural scene.
MIT License
634 stars 88 forks source link

Why is value of Camera->GetViewMatrix() is shaking between positive and negative #13

Open liumingqian opened 5 years ago

liumingqian commented 5 years ago

image

This is part of value i printed,I print as follows in "camera.h": image

They are shaking between positive and negative while the camera position is settled. "invertPitch()" every frame made me failed when i get viewMatrix from camera and try to make some ray intersection operations.I personally think that it would be good to add another interface or datastruct to solve this problem.

Any help or explaination would be appreciate! Plus I like this program very much(thumb up)

fede-vaccaro commented 4 years ago

Hi there, sorry for the very late reply.

It should be due to the off-screen reflection rendering. During this phase the camera's pitch is first inverted, then reverted again.

Actually i'm not actively supporting this repository, it was made mainly for fun and i have not much time available for working on it...