我一直很难计算出我的WebGL场景的矩阵数学。我试过的任何东西似乎都没有正确显示。
在我的3D世界里,我有很多模型。每个模型都有一个XYZ矢量,用于世界范围内的位置、旋转和比例尺。相机有一个位置和旋转矢量。
将这些向量转换成模型视图矩阵的最佳方法(显然是有效的)是什么?
谢谢!)
发布于 2014-10-15 14:22:24
生成模型视图矩阵的完整方法通常如下所示:
1. Set up view matrix V (inverse of camera) from camera orientation vectors
2. Set up model translation matrix T from model position vector
3. Set up model rotation matrix R from model orientation vectors
4. Set up model scaling matrix S
5. MV = V // initialize model-view matrix MV with the view matrix V
6. MV = V*T // apply the model translation matrix T
7. MV = V*T*R // apply the model rotation matrix R
8. MV = V*T*R*S // apply the model scaling matrix Shttps://stackoverflow.com/questions/26383847
复制相似问题