如何从投影矩阵中提取相机参数

时间:2019-06-03 13:57:02

标签: javascript three.js projection-matrix

我有一台带有特定投影矩阵的透视相机,我只想从中提取飞行器,近平面和远平面。 我知道Three.js中有一个功能:

auto

它根据上面列出的参数创建一个投影矩阵,基本上我想要反向过程。

1 个答案:

答案 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);

来源:

3D Projection

Decompose the OpenGL projection matrix

Field of view + Aspect Ratio + View Matrix from Projection Matrix