Why is there a glMatrixMode in OpenGL?

后端 未结 4 502
攒了一身酷
攒了一身酷 2021-02-05 13:10

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

4条回答
  •  暖寄归人
    2021-02-05 13:16

    As Nils pointed out, you do have more to matrices than just what you mentioned.

    I'll add a couple thoughts:

    • OpenGL core (from 3.1 onwards) does away with all the matrix stuff completely, so does GL ES 2.0. This is simply due to the fact that shader programs removed much of the requirement of having them exposed at the GL level (it's still a convenience, though). You then only have uniforms, and you have to compute their value completely on the client side.

    • There are more matrix manipulation entrypoints than the ones you mention. Some of them apply equally well to projection/modelview (glLoadIdentity/glLoadMatrix/glMultMatrix, Push/Pop), They are very useful if you want to perform the matrix computation yourself (say because you need them somewhere else in your application).

提交回复
热议问题