我有一台带有特定投影矩阵的透视相机,我只想从中提取飞行器,近平面和远平面。 我知道Three.js中有一个功能:
auto
它根据上面列出的参数创建一个投影矩阵,基本上我想要反向过程。
答案 0 :(得分:0)
我用以下3个公式求解:
关注 = 2 * atan(1 / camera.projectionMatrix.elements [5])* 180 / PI;
附近 = camera.projectionMatrix.elements [14] /(camera.projectionMatrix.elements [10]-1.0);
远 = camera.projectionMatrix.elements [14] /(camera.projectionMatrix.elements [10] + 1.0);
来源:
Decompose the OpenGL projection matrix
Field of view + Aspect Ratio + View Matrix from Projection Matrix