3
將變換應用於對象時,我們使用glPushMatrix/glPopMatrix。但是,爲什麼我們不僅僅使用glLoadIdentity呢?glLoadIdentity和glPushMatrix/glPopMatrix,爲什麼不使用前者?
因此
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
這是它應該怎麼做吧?
可以成爲
glLoadIdentity()
..apply tranformations
...draw object
glLoadIdentity()
..apply tranformations
...draw object