pia*_*aac 1 javascript math 3d three.js
对于 Three.js 中的相机移动,我需要计算 pointC以便将相机从 point 移动A到一定距离dist到 point B。

Three.js 有很容易做到这一点的方法。
假设a、b和c是 的实例THREE.Vector3(),
a.set( 2, 1, 4 );
b.set( 9, 4, 2 );
c.subVectors( a, b ).setLength( dist ).add( b );
Run Code Online (Sandbox Code Playgroud)
三.js r.91