轨道相机 lookAt 变化
Orbit camera lookAt change
有没有可能改变轨道相机的lookAt
目标?
我已经为我的 'static' 相机设置了它,但是当激活轨道相机时它总是看着 (0,0,0)。
OrbitControls
和TrackballControls
都有一个属性target
,既是旋转中心又是相机注视点。
你可以这样设置:
controls.target.set( x, y, z );
three.js r.71
您有几个选项可以设置相机控制目标的位置。
使用哪个更适合你。
// One axis at a time
controls.target.x = xPos;
controls.target.y = yPos;
controls.target.z = zPos;
// All axis at once
controls.target.set( x, y, z );
// Copy another mesh's position
controls.target.copy( someMesh.position );
有没有可能改变轨道相机的lookAt
目标?
我已经为我的 'static' 相机设置了它,但是当激活轨道相机时它总是看着 (0,0,0)。
OrbitControls
和TrackballControls
都有一个属性target
,既是旋转中心又是相机注视点。
你可以这样设置:
controls.target.set( x, y, z );
three.js r.71
您有几个选项可以设置相机控制目标的位置。
使用哪个更适合你。
// One axis at a time
controls.target.x = xPos;
controls.target.y = yPos;
controls.target.z = zPos;
// All axis at once
controls.target.set( x, y, z );
// Copy another mesh's position
controls.target.copy( someMesh.position );