opengl笔记—— glMultMatrixf() 区别 glLoadMatrixf()
能找到最好的解释来自:http://www.gamedev.net/topic/489879-glpushmatrixglpopmatrix--glloadmatrixf/
原理:
glPushMatrix didn't fail to push onto the stack; it's job is to push a copy of the current matrix onto a stack of matrices. Those matrices on the stack don't interact at all. You only manipulate the current, top-most, matrix at any given time.
Example 1:
command resultglLoadMatrixf(A) stack = [A]glPushMatrix() stack = [A, A]glLoadMatrixf(B) stack = [B, A]glPopMatrix() stack = [A]
command resultglLoadMatrixf(A) stack = [A]glPushMatrix() stack = [A, A]glMultMatrixf(B) stack = [AB, A]glPopMatrix() stack = [A]
实例:
看下面的代码:
770 glLoadMatrixf(matrixModelView.getTranspose());不能是glMultMatrixf