I just don\'t understand what OpenGL\'s glMatrixMode
is for.
As far as I can see, when glMatrixMode(GL_MODELVIEW)
is called, it
is followed by
This is simple and can be answered very briefly:
Rendering vertices (as in glVertex
) depends on the current state of matrices called "model-view matrix" and "projection matrix",
The commands glTranslatef
, glPushMatrix
, glLoadIdentity
, glLoadMatrix
, glOrtho
, gluPerspective
and the whole family affect the current matrix (which is either of the above),
The command glMatrixMode
selects the matrix (model-view or projection) which is affected by the forementioned commands.
(Also, there's also the texture matrix used for texture coordinates, but it's seldomly used.)
So the common use case is: