2012-03-01 162 views

回答

9

将预,后功能分别用于前,后的乘法运算。

例如,调用以下功能:

reset(); //reset to identity matrix 
setRotate(90); //set the matrix to be a 90 degree rotation 
preScale(2.0f,2.0f); //scale uniformly with factor 2 

reset(); //reset to identity matrix 
setRotate(90); //set the matrix to be a 90 degree rotation 
postScale(2.0f,2.0f); //scale uniformly with factor 2 

现在,有什么区别?

在第一个版本中,最终矩阵首先缩放然后旋转。第二,反之亦然。

Pre函数构造一个矩阵并将它从右乘到现有的矩阵后函数从左边乘。

相关问题