PDA

View Full Version : rotating around an arbitary axis



06-24-2003, 08:10 AM
I have an object that I want to rotate first 30 degree around the X axis. I want to then rotate it around the Y axis. But i want to rotate it around the Y axis that is vertical to the camera, not the real Y axis (which rotated when i rotated around the X axis the first time). How do I rotate around the Y axis that I want ?

Thanks

nexusone
06-24-2003, 08:36 AM
Would look something like this:

glPushMatrix();
glRotatef( 30,1, 0,0); X-rotation
glRotatef( y_angle , 0, 1, 0); Y-rotation
glTranslatef( 0, y_axis_offset, 0); Offset Y axis
draw_object();
glPopMatrix();


Originally posted by line:
I have an object that I want to rotate first 30 degree around the X axis. I want to then rotate it around the Y axis. But i want to rotate it around the Y axis that is vertical to the camera, not the real Y axis (which rotated when i rotated around the X axis the first time). How do I rotate around the Y axis that I want ?

Thanks



[This message has been edited by nexusone (edited 06-24-2003).]