将变换应用于对象时,我们使用glPushMatrix/glPopMatrix.但为什么我们不使用glLoadIdentity呢?
从而
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
Run Code Online (Sandbox Code Playgroud)
这应该是怎么做的吧?
可以变成
glLoadIdentity()
..apply tranformations
...draw object
glLoadIdentity()
..apply tranformations
...draw object
Run Code Online (Sandbox Code Playgroud)
因为你无法做到这一点:
glPushMatrix()
..apply tranformations
glPushMatrix()
..apply ADDITIONAL transformations
..draw object with combined transforms
glPopMatrix()
...draw object without the additional transforms.
glPopMatrix()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1396 次 |
| 最近记录: |