【问题标题】:Adjust the camera display the world from y=0 and go down调整相机显示世界从 y=0 往下走
【发布时间】:2013-11-16 21:24:21
【问题描述】:

在 Three.js 中,我希望渲染区域的顶部(第一行)指向世界中的 y=0

另外,相机需要直视(lookAt)

这是我的价值观:

camera = PerspectiveCamera
camera.position.z = 1895.8448868133867
camera.fov = 20
screen.width = 1280
screen.height = 689
camera.lookAt( new THREE.Vector3(0,this.camera.position.y,0) )

我知道结果是 -264 (camera.position.y),但我不知道如何到达那里...

感谢您的帮助! :-)

【问题讨论】:

标签: javascript 3d three.js


【解决方案1】:

我想通了。

var vFOV = camera.fov * Math.PI / 180;
var height = 2 * Math.tan( vFOV / 2 ) * dist;

camera.position.y = (height/2) * -1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-20
    相关资源
    最近更新 更多