I’ve been programming for a while now on OpenGL and after implementing the gluLookAt function I found out that if the target goes 90 degrees sideways of the viewer (turn 90 degrees from original location) the camera spins sideways. If I were to change the Y axis the entire scene just rotates!

I’m well aware that this is a basic problem yet I’ve been unable to find on the web (and on this forum) any solution, and switching to rotation matrixes cant be a solution here.

I think there must be a solution involving the up vector, but I’ve got no idea as to the calculations needed to perform in order to “neutralize” the spining effect.

Thanks for the help