I just don't get why there is a glMatrixMode in OpenGL

Posted by René Nyffenegger on Stack Overflow See other posts from Stack Overflow or by René Nyffenegger
Published on 2010-12-30T21:54:00Z Indexed on 2010/12/31 12:53 UTC
Read the original article Hit count: 128

Filed under:

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 glVertex, glTranslate, glRotate and the like, that is, OpenGL commands that place some objects somewhere in the space. On the other hand, if glOrtho or glFrustum or gluProjection is called (ie how the placed objects are rendered), it has a preceeding call of glMatrixMode(GL_PROJECTION).

I guess what I have written so far is an assumption on which someone will prove me wrong, but is not the point of using different *Matrix Mode*s exactly because there are different kinds of gl-functions: those concerned with placing objects and those with how the objects are rendered?

So, if someone could shed some light on this issue, I'd certainly appreciate it.

© Stack Overflow or respective owner

Related posts about opengl