私は、球の周りの軌道上を回転するオブジェクトに続くカメラを作成しようとしています。しかし、カメラが軌道の極座標に達するたびに、方向が変わります。私はその二乗で別のフィドルを作成しましたhttp://jsfiddle.net/krw8nwLn/69/円の軌跡を描くカメラのセットアップ方法は?
:
function render() {
rotation += 0.002;
// set the marker position
pt = path.getPoint(t);
// set the marker position
marker.position.set(pt.x, pt.y, pt.z);
marker.lookAt(new THREE.Vector3(0,0,0));
// rotate the mesh that illustrates the orbit
mesh.rotation.y = rotation
// set the camera position
var cameraPt = cameraPath.getPoint(t);
camera.position.set(cameraPt.x, cameraPt.y, cameraPt.z);
camera.lookAt(marker.position);
t = (t >= 1) ? 0 : t += 0.002;
renderer.render(scene, camera);
}
ここで完全なフィドルだ:私はちょうど従う必要があり、その後lookAt
を呼び出すとされているオブジェクトに応じてカメラの位置を設定しますhttp://jsfiddle.net/krw8nwLn/70/
あなたの2つのリンクが同じURLを指しています –
ああ、申し訳ありません!私は質問を更新しました:) – Slevin