Modern OpenGL: VBO, GLM and Matrix Stacks

后端 未结 4 1375
一向
一向 2020-12-09 13:15

After searching and reading about Modern OpenGL in order to upgrade my existing project, I\'m a bit confused, since my 3D framework based on OpenGL 2.1.

so, as far a

4条回答
  •  独厮守ぢ
    2020-12-09 14:04

    Yes, if you need hierarchical transformations, then you have to do it on your own. However, that is pretty much trivial if all you need is a stack. Just take the last entry on the stack and multiply it with the next matrix you want to apply, and push the result onto the stack.

    [On your edited question]: You don't need a stack at all for this, and there's no hierarchical transformation either. Just have a single matrix and apply your translation, draw, multiply it with your rotation matrix, draw, multiply your scaling, draw.

提交回复
热议问题