gimble lock
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
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?
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement