Can anyone please tell me why in this code the first quad won’t rotate?
(BTW. I’m using GLUT, if that helps.)
Display()
{
glPushMatrix();
glBegin(GL_QUADS);
glTexCoord2i(0,0);
glVertex3f(0.0,0.0,0.0);
glTexCoord2i(0,1);
glVertex3f(0.0,1.0,0.0);
glTexCoord2i(1,1);
glVertex3f(1.0,1.0,0.0);
glTexCoord2i(1,0);
glVertex3f(1.0,0.0,0.0);
glEnd();
glRotated(2,0,1,0);
glPopMatrix();
glPushMatrix();
glBegin(GL_QUADS);
glTexCoord2i(0,0);
glVertex3f(0.0,0.0,0.0);
glTexCoord2i(0,1);
glVertex3f(0.0,1.0,0.0);
glTexCoord2i(1,1);
glVertex3f(1.0,1.0,0.0);
glTexCoord2i(1,0);
glVertex3f(1.0,0.0,0.0);
glEnd();
glPopMatrix();
}
The first object won’t rotate. If I place glRotated() outside the glPushMatrix()/PopMatrix() calls, both quads will rotate. For some reason in between it won’t rotate…