1.介绍
之前的文章中有将投影矩阵和相机视图变换矩阵结合的一个方法,生成一个新的矩阵mMVPMatrix。
- Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mViewMatrix, 0);
看官方文档:
public static void multiplyMM (float[] result, int resultOffset, float[] lhs, int lhsOffset, float[] rhs, int rhsOffset)
Multiplies two 4x4 matrices together and stores the result in a third 4x4 matrix. In matrix notation: result = lhs x rhs.
将两个4x4矩阵相乘,并将结果存储在第三个4x4矩阵中。以矩阵表示法表示:结果=lhs x rhs。
Parameters
result | The float array that holds the result. 保存结果的浮点数数组。 |
---|---|
resultOffset | The offset into the result array where the result is stored. |
lhs | The float array that holds the left-hand-side matrix. 保存左侧矩阵的浮点数数组。 |
lhsOffset | The offset into the lhs array where the lhs is stored |
rhs | The float array that holds the right-hand-side matrix. 包含右侧矩阵的浮点数数组 |
rhsOffset | The offset into the rhs array where the rhs is stored. |