query on pop/push matrixes

what is the actual purpose and meaning of popping/pushing matrixes? does it save the previous scene?

Originally posted by coda:
what is the actual purpose and meaning of popping/pushing matrixes? does it save the previous scene?

No, just the projection or modelview matrix. You don’t seem to know that matrices are used for transformations/projections, for instance when you rotate, translate, scale your objects. Try to read some reference book on computer graphics.

Its store current rotations and translations, scale ect, which are in the model matrix.

It does not store any scene data.

Remember all matrix operations are cumlative, so in order to have future object that are draw not effected by some rotation or translation we use push/pop matrix.

Lets say we want to view all object from a 45 degree angle and we want to rotate only one object on it axis.

glRotatef(45, 1.0,0.0, 0.0);

glPushMatrix(); Save matrix state
glRotatef(RX,0.0, 1.0, 0.0);
Draw_object();
glPopMatrix(); // Restore matrix
Draw_object();

Only the object between the Push/Pop Matrix will be effect by the glRotate RX.

Originally posted by coda:
what is the actual purpose and meaning of popping/pushing matrixes? does it save the previous scene?