Search code examples
c++openglgraphicsopengl-compat

In opengl, Can I use two MatrixMode at the same time?


My question is simple. I wonder if I can use GL_MODELVIEW and GL_PROJECTION at the same time or not ?


Solution

  • Both model-view and projection matrices are always active, i.e. the positions of vertices you draw are multiplied by both.

    glMatrixMode only affects which matrix is modified when you call the matrix-related functions (glLoadIdentity|Rotate|Translate, etc). Those always modify one of the two matrices, never both.