Archived

This topic is now archived and is closed to further replies.

roguetroop

gimble lock

Recommended Posts

I''m am a newbie programmer and I am using open gl to try to write a video game. I have been trying to find a way to rotate and translate from the "viewer''s" position and not the origin. I have read many articles on this and I still can''t get past gimble lock. My math is not good and I need a short example of how to fix my problem. This is what I am doing now: ... glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 70.0); glRotatef(rx, 1.0f, 0.0f, 0.0f); glRotatef(ry, 0.0f, 1.0f, 0.0f); glRotatef(rz, 0.0f, 0.0f, 1.0f); glTranslatef(x,y,z); ... Any help would be greatly appreciated sincerely john roguetroop@hotmail.com

Share this post


Link to post
Share on other sites
I sugest you do a google search for gimbal lock, which will point you to either quaternions, or ''eulers are bad''.

Then you can do a search on quaternions & matrices.

Oh, and if you are not going to have 6DOF, then you don''t have gimbal lock...and why are you modifying the projection matrix instead of the model view matrix?



Share this post


Link to post
Share on other sites
its impossible to get rid of the gimbal lock problem using eulars
. u need quaternions or matrices (an example of rotating by quats is on my site nv_reflection_map extension IIRC )

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites