I want to write a function for rotating an object around its axis contemporaneously with passing the each angle around its x, y and z axis; I read here but I did not understand it completely. for example for rotating around my shape's axis, which parameters I must pass to the glTranslatef() and the How does the matrix which is multiplied to [0 1 0] (for calculating the new y axis) created?
I do not understand why when I call glRotatef() for several time, I just saw the first call in output; I tested gltranslatef and glPushMatrix and glPopMatrix befor and after my code; but none of them help me; it is very important for me to understand the solution of this topic.
this is my code but it does not work!
glPushMatrix();
glRotatef(90,1,0,0); // rotate around X Axis
glPopMatrix();
glPushMatrix();
glRotatef(90,0,1,0); // rotate around Y Axis
glPopMatrix();
glPushMatrix();
glRotatef(90,0,0,1); // rotate around Z Axis
glPopMatrix();
if you did this tell me your way.