Camera Controls in Three.js: TrackballControls
Learn how to use the TrackballControls in Three.js.
We'll cover the following...
We'll cover the following...
The TrackballControls
Using TrackballControls follows the same approach as for ArcballControls:
This time, we just need to pass in the camera and domeElement properties from the renderer. For the TrackballControls to work, we also need to add a THREE.Clock and update the render loop, like so:
In the preceding code snippet, we can see a new Three.js object, THREE.Clock (line 1). The THREE.Clock object can be used to calculate the elapsed time that a specific ...