本文共 1881 字,大约阅读时间需要 6 分钟。
3D????????????????????????????????3D???????????????????????????????
?3D??????????????????X?Y?Z????????????????
???Dot Product?????????????????????????????[u \cdot v = u_x v_x + u_y v_y + u_z v_z]??????????????????????[\cos\theta = \frac{u \cdot v}{|u| |v|}]
???Cross Product?????????????????????????????????????????????????????[u \times v = \begin{vmatrix}\mathbf{i} & \mathbf{j} & \mathbf{k} \u_x & u_y & u_z \v_x & v_y & v_z\end{vmatrix}]????????????????????????????
?????3D??????????3D?????3x3?4x4?????????????????????
????????3D????????????????????X?Y?Z???????????[R_x(\theta) = \begin{pmatrix}1 & 0 & 0 \0 & \cos\theta & -\sin\theta \0 & \sin\theta & \cos\theta\end{pmatrix}]?????????????
?????????????????3D???????????????????4x4???????????[H = \begin{pmatrix}1 & 0 & 0 & 0 \0 & 1 & 0 & 0 \0 & 0 & 1 & 0 \0 & 0 & 0 & 1\end{pmatrix}]
?OpenGL?????????3D????????GLMatrixStack????????????????????????????????
?????????[GLMatrixStack::GLMatrixStack(int iStackDepth = 64)]??????64???????
???????[void GLMatrixStack::LoadIdentity(void);]?????????????
?????[void GLMatrixStack::Translate(float x, float y, float z);][void GLMatrixStack::Rotate(float angle, float x, float y, float z);][void GLMatrixStack::Scale(float x, float y, float z);]???????????????????????
?????[void GLMatrixStack::MultMatrix(const M3DMatrix44f& matrix);]????????????????????
???????GLMatrixStack????????????
// ???????GLMatrixStack matrixStack;matrixStack.LoadMatrix(m3dMatrix);// ????matrixStack.Translate(translateX, translateY, translateZ);matrixStack.Rotate(rotationX, rotationY, rotationZ);matrixStack.Scale(scaleX, scaleY, scaleZ);// ????????M3DMatrix44f transformedMatrix = matrixStack.GetMatrix();
3D??????????????????????????????3D????????????????????????????????????3D?????????????????GLMatrixStack??????????????????????????????????
转载地址:http://nzpfk.baihongyu.com/