Evil-Dog
07-29-2001, 09:12 AM
I'm looking for a way to do my rotation around x,y and z indepently to prevent that the second rotation depends on the first one.
I don't know if my request is clear.
I have that code :
glTranslatef(GetPos().x, GetPos().y, GetPos().z);
glRotatef(GetAngle().x,1.0f,0.0f,0.0f);
glRotatef(GetAngle().y,0.0f,1.0f,0.0f);
glRotatef(GetAngle().z,0.0f,0.0f,1.0f);
The object have it's own x,y and z rotation angle
This objective is to have like a spaceship that can turn left/right, roll left/right and pitch up/down
but for exemple if I turn left 90 degrees the pitch down with in fact roll the spaceship cause the ship is now turned....you see the problem ? It's tough to explain...Hope you understand...
The weird thing is that the first works fine....the second depends on the first and the third is fine....
Help me please !!
Thanks for your concern ! http://www.opengl.org/discussion_boards/ubb/smile.gif
I don't know if my request is clear.
I have that code :
glTranslatef(GetPos().x, GetPos().y, GetPos().z);
glRotatef(GetAngle().x,1.0f,0.0f,0.0f);
glRotatef(GetAngle().y,0.0f,1.0f,0.0f);
glRotatef(GetAngle().z,0.0f,0.0f,1.0f);
The object have it's own x,y and z rotation angle
This objective is to have like a spaceship that can turn left/right, roll left/right and pitch up/down
but for exemple if I turn left 90 degrees the pitch down with in fact roll the spaceship cause the ship is now turned....you see the problem ? It's tough to explain...Hope you understand...
The weird thing is that the first works fine....the second depends on the first and the third is fine....
Help me please !!
Thanks for your concern ! http://www.opengl.org/discussion_boards/ubb/smile.gif