LoginSignup
2
3

More than 5 years have passed since last update.

Three.jsのOrbitControls.jsの導入

Posted at

OrbitControls.jsとは、マウスを使って視点を自由に動かせるようにするものです。

OrbitControlsはThree.jsに記述されているクラスではなく、OrbitControls.jsに書かれています。

sample
http://codepen.io/taku/pen/oXKrQe?editors=001

解説

追加するのは2つだけです。

var controls = new THREE.OrbitControls(camera);

カメラがあるところに、これを追加します。

controls.update();

そして、毎回描画がされる際によびだします。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3