我无法将这些功能从使用 glMatrix 1.2 的旧应用程序更新到 glMatrix 2.7:
calculateNormal() {
mat4.identity(this.normalMatrix);
mat4.set(this.modelViewMatrix, this.normalMatrix);
mat4.inverse(this.normalMatrix);
mat4.transpose(this.normalMatrix);
}
并且不存在以下将矩阵乘以 4 分量向量的函数:
calculateOrientation() {
mat4.multiplyVec4(this.matrix, [1, 0, 0, 0], this.right);
mat4.multiplyVec4(this.matrix, [0, 1, 0, 0], this.up);
mat4.multiplyVec4(this.matrix, [0, 0, 1, 0], this.normal);
}