[name] is similar to [page:OrbitControls]. However, it does not maintain a constant camera [page:Object3D.up up] vector. That means if the camera orbits over the “north” and “south” poles, it does not flip to stay "right side up".
[name] is an add-on, and must be imported explicitly. See [link:#manual/introduction/Installation Installation / Addons].
import { TrackballControls } from 'three/addons/controls/TrackballControls.js';
[example:misc_controls_trackball misc / controls / trackball ]
[page:Camera camera]: The camera of the rendered scene.
[page:HTMLDOMElement domElement]: The HTML element used for event listeners.
Creates a new instance of [name].
Fires when the camera has been transformed by the controls.
Fires when an interaction (e.g. touch) was initiated.
Fires when an interaction has finished.
The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will not set up new event listeners.
Defines the intensity of damping. Only considered if [page:.staticMoving staticMoving] is set to `false`. Default is `0.2`.
Whether or not the controls are enabled.
How far you can dolly out ( [page:PerspectiveCamera] only ). Default is `Infinity`.
How far you can dolly in ( [page:PerspectiveCamera] only ). Default is *0*.
How far you can zoom out ( [page:OrthographicCamera] only ). Default is `Infinity`.
How far you can zoom in ( [page:OrthographicCamera] only ). Default is *0*.
Whether or not panning is disabled. Default is `false`.
Whether or not rotation is disabled. Default is `false`.
Whether or not zooming is disabled. Default is `false`.
The camera being controlled.
The pan speed. Default is `0.3`.
The rotation speed. Default is `1.0`.
Whether or not damping is disabled. Default is `false`.
The focus point of the controls.
The zoom speed. Default is `1.2`.
Ensures the controls stay in the range [minDistance, maxDistance]. Called by [page:.update update]().
Should be called if the controls is no longer required.
Should be called if the application window is resized.
Performs panning if necessary. Called by [page:.update update]().
Resets the controls to its initial state.
Rotates the camera if necessary. Called by [page:.update update]().
Updates the controls. Usually called in the animation loop.
Performs zooming if necessary. Called by [page:.update update]().
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/TrackballControls.js examples/jsm/controls/TrackballControls.js]