const camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);
我们从光学上知道,摄像机的视场与焦距的关系如下式所示
FOV = arctan(d/2f)
哪里
FOV
是垂直视场,单位为度,
d
是图像平面的高度,单位为mm,并且
f
是相机的焦距,单位为mm。
读后
the documentation
D
默认情况下设置为
35mm / aspectRatio
.
我们可以表达
视野
FOV = arctan((35/(width/height))/2f) = arctan(filmHeight / 2f)
作为一个健全性检查,我打印了以下值,以查看是否可以返回
75
.
Math.atan(camera.getFilmHeight()/(2 * camera.getFocalLength())) * 180 / Math.PI;
但是这个值被证明是
37.50000000000001
正好是预期焦距的一半
.