pango
01-06-2003, 04:10 AM
I wrote codes below to rotate a cube aroud x axes first,and then rotate around Y axes:
glPushMatrix();
glRotatef(90.0,0,1,0);
glRotatef(90.0,1,0,0);
glTranslatef(0,0,-5);
DrawCube();
glPopMatrix();
but I fail,after execuete the "glRotatef(90.0,1,0,0);" statement,the Y axes also rotate around x,and then execuete the "glRotatef(90.0,0,1,0);" statement,the cube looks like turn round z axes,so I fail.
anyone can help me?how to rotate a object around different axes for many times?
glPushMatrix();
glRotatef(90.0,0,1,0);
glRotatef(90.0,1,0,0);
glTranslatef(0,0,-5);
DrawCube();
glPopMatrix();
but I fail,after execuete the "glRotatef(90.0,1,0,0);" statement,the Y axes also rotate around x,and then execuete the "glRotatef(90.0,0,1,0);" statement,the cube looks like turn round z axes,so I fail.
anyone can help me?how to rotate a object around different axes for many times?