PDA

View Full Version : rotation question



mdog1234
06-13-2003, 06:09 AM
I would like to be able to rotate a model around the center of the screen. I would also like to be able to have an x,y,z axis rotate in the bottom right hand corner of the screen but about its own axis. This axis should rotate at the same time that the model rotates so that a user can see which direction the x,y and z coordinates are. Does anyone know how to do this. My problem right now is that the axis rotates around the same point as the model which is very bad.

nexusone
06-13-2003, 08:16 AM
Do you know how to use push/pop matrix?

// Object one
glPushMatrix();
glTranslate // Location on screen
glRotate // Rotate around objectx axis
draw_object_1();
glPopMatrix();

// Object two
glPushMatrix();
glTranslate // Location on screen of second object
glRotate // Rotate second object round its axis.
draw_object_2();
glPopMatrix();



Originally posted by mdog1234:
I would like to be able to rotate a model around the center of the screen. I would also like to be able to have an x,y,z axis rotate in the bottom right hand corner of the screen but about its own axis. This axis should rotate at the same time that the model rotates so that a user can see which direction the x,y and z coordinates are. Does anyone know how to do this. My problem right now is that the axis rotates around the same point as the model which is very bad.

mdog1234
06-13-2003, 12:28 PM
Yes I know how to push and pop. I didnt realize it was that simple