File: TrackballControls.md | Updated: 11/15/2025
This class is similar to OrbitControls. However, it does not maintain a constant camera up vector. That means if the camera orbits over the “north” and “south” poles, it does not flip to stay "right side up".
TrackballControls is an addon, and must be imported explicitly, see Installation#Addons.
import { TrackballControls } from 'three/addons/controls/TrackballControls.js';
Constructs a new controls instance.
object | The object that is managed by the controls.
---|---
domElement | The HTML element used for event listeners. Default is null.
Defines the intensity of damping. Only considered if staticMoving is set to false.
Default is 0.2.
This array holds keycodes for controlling interactions.
Default is KeyA, KeyS, KeyD which represents A, S, D.
Overrides: Controls#keys
How far you can dolly out (perspective camera only).
Default is Infinity.
How far you can zoom out (orthographic camera only).
Default is Infinity.
How far you can dolly in (perspective camera only).
Default is 0.
How far you can zoom in (orthographic camera only).
Default is 0.
This object contains references to the mouse actions used by the controls.
controls.mouseButtons = {
LEFT: THREE.MOUSE.ROTATE,
MIDDLE: THREE.MOUSE.DOLLY,
RIGHT: THREE.MOUSE.PAN
}
Overrides: Controls#mouseButtons
Whether panning is disabled or not.
Default is false.
Whether rotation is disabled or not.
Default is false.
Whether zooming is disabled or not.
Default is false.
The pan speed.
Default is 0.3.
The rotation speed.
Default is 1.
Represents the properties of the screen. Automatically set when handleResize() is called.
Whether damping is disabled or not.
Default is false.
The focus point of the controls.
The zoom speed.
Default is 1.2.
Must be called if the application window is resized.
Resets the controls to its initial state.
Fires when the camera has been transformed by the controls.
Fires when an interaction has finished.
Fires when an interaction was initiated.