5
함수 matrix.preScale(x,y)
은 어떻게 작동하며 어떻게 사용됩니까?matrix.preScale (x, y) 사용 방법
사용 예는 :
matrix.preScale(1.0f, 1.0f);
함수 matrix.preScale(x,y)
은 어떻게 작동하며 어떻게 사용됩니까?matrix.preScale (x, y) 사용 방법
사용 예는 :
matrix.preScale(1.0f, 1.0f);
사전, 사후 함수는 각각 전후 곱하기 위해 사용된다.
예를 들어, 다음과 같은 기능을 호출
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
을, 차이점은 무엇입니까?
첫 번째 버전에서는 최종 행렬이 먼저 축척 된 다음 회전합니다. 두 번째는 반대입니다.
사전 함수는 행렬을 구성하고 오른쪽에서 기존 행렬 후행 함수에 왼쪽으로 곱하는 곱셈을합니다.