hi!
i have the 3 X,Y,Z axes rendered using glut and rotation of the scene using the mouse.
i noticed while playing with it, rotation around the Z axis rotates the object(the 3 axes) around the local Z axis while attempting to rotate around the X/Y axes causes the scene to rotate around the global X/Y axes. The following code is taken from my “display()” function.
I notice that if i swap the order of the 3 rotations, the last one will rotate around the local axis.
How can i cause all the rotations to work either locally or globally and not a mix as it is at present?
thanks
patric
glPushMatrix();
glLoadIdentity ();
glTranslatef(changeTX, -changeTY, 0.0);
glRotatef (changeRY, 0.0, 1.0, 0.0);
glRotatef (changeRX, 1.0, 0.0, 0.0);
glRotatef (changeRZ, 1.0, 0.0, 0.0);
glBegin(GL_LINES);
glVertex3d(0,0,0);
glVertex3d(0,0,4);
glEnd();
glBegin(GL_LINES);
glVertex3d(0,0,0);
glVertex3d(4,0,0);
glEnd();
glBegin(GL_LINES);
glVertex3d(0,0,0);
glVertex3d(0,4,0);
glEnd();