Can someone explain what is happening in the example below:
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glRotatef(45,0,0,1);
DrawCube();
glTranslatef(4,0,0);
glRotatef(-45,0,0,1);
DrawCube();
glPopMatrix();
I am assuming that it will just rotate the square, shift it right 4 units, and then rotate it back to its original rotation. It seems too easy though, is there something I am missing?