2012-03-01 20 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函數構造一個矩陣並將它從右乘到現有的矩陣後函數從左邊乘。

相關問題