HenriH
08-27-2008, 09:54 PM
I want to verify one thing:
Lets say I want to rotate an object (in this order) 30 degrees around the Y-axis, 20 degrees around the X-axis and finally 10 degrees around the Z-axis, what is the correct order of applying the rotation matrices in OpenGL?
Is it Z*X*Y, like this:
glRotatef (10.0f, 0.0f, 0.0f, 1.0f);
glRotatef (20.0f, 1.0f, 0.0f, 0.0f);
glRotatef (30.0f, 0.0f, 1.0f, 0.0f);
or Y*X*Z, such as:
glRotatef (30.0f, 0.0f, 1.0f, 0.0f);
glRotatef (20.0f, 1.0f, 0.0f, 0.0f);
glRotatef (10.0f, 0.0f, 0.0f, 1.0f);
Thanks.
Lets say I want to rotate an object (in this order) 30 degrees around the Y-axis, 20 degrees around the X-axis and finally 10 degrees around the Z-axis, what is the correct order of applying the rotation matrices in OpenGL?
Is it Z*X*Y, like this:
glRotatef (10.0f, 0.0f, 0.0f, 1.0f);
glRotatef (20.0f, 1.0f, 0.0f, 0.0f);
glRotatef (30.0f, 0.0f, 1.0f, 0.0f);
or Y*X*Z, such as:
glRotatef (30.0f, 0.0f, 1.0f, 0.0f);
glRotatef (20.0f, 1.0f, 0.0f, 0.0f);
glRotatef (10.0f, 0.0f, 0.0f, 1.0f);
Thanks.