Original Post
Hi,
I''ve recently been trying to learn 3d programming, and I''ve got a problem that I haven''t been able to work around for weeks.
I have a camera. Moving it around is no problem. I can move it forward and backward, strafe, and rotate with the mouse.
I''m using quaternions for rotation, so I know my problem isn''t Gimbal Lock.
When I''m rotating with the mouse, I get a problem when the Z Direction of the camera should equal/cross over the Z Position of the camera. In this instance, the image starts to mirror itself wildly and I can''t move the camera any further in that direction. I think I''ve traced the problem to the gluLookAt function and the Up Vector. I''ve tried changing the Up Vector to solve the problem (changing it from 0,1,0 to 0,-1,0 in certain instances), but the solution does not work flawlessly. I''ve also tried changing the way I handle my camera via not using gluLookAt and instead using glTranslate and glMultMatrixf with a rotation matrix. However, I haven''t really been able to get this approach to produce realistic looking results.
I was hoping someone would know the solution to my problem or be able to point me in the right direction toward making a realistic looking camera with translations and matrix multiplications.
Thanks,
--Nairb