1
\$\begingroup\$

I'm trying to rotate the camera view in PyOpenGL, but it's not working well. The weirdest behavior I've noticed is that putting gluLookAt in a loop seems to change the camera view, even when I'm not changing the inputs as the loop continues.

So while I'd expect something like:

gluLookAt(0,0,0, 0,0,-5, 0,0,1)

to keep the camera constantly pointing downwards, it seems to rotate the view in some strange way, with the objects being rendered leaving the maximum clipping radius after a while.

My question is, does gluLookAt take into account the previous camera settings, or do I need to look for something else wrong in my code?

\$\endgroup\$
1
\$\begingroup\$

https://www.khronos.org/opengl/wiki/GluLookAt_code

gluLookAt computes a matrix and multiplies it with the current matrix. You need to use glLoadIdentity before using gluLookAt, in other words.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.