[page:EventDispatcher] →

[name]

[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".

Examples

[example:misc_controls_trackball misc / controls / trackball ]

Constructor

[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )

[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].

Events

change

Fires when the camera has been transformed by the controls.

start

Fires when an interaction (e.g. touch) was initiated.

end

Fires when an interaction has finished.

Properties

.domElement : HTMLDOMElement

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.

.dynamicDampingFactor : Number

Defines the intensity of damping. Only considered if [page:.staticMoving staticMoving] is set to `false`. Default is `0.2`.

.enabled : Boolean

Whether or not the controls are enabled.

.keys : Array

This array holds keycodes for controlling interactions.

Default is *KeyA, KeyS, KeyD* which represents A, S, D.

.maxDistance : Number

How far you can zoom out. Default is `Infinity`.

.minDistance : Number

How far you can zoom in. Default is *0*.

.mouseButtons : Object

This object contains references to the mouse actions used by the controls.

.noPan : Boolean

Whether or not panning is disabled. Default is `false`.

.noRotate : Boolean

Whether or not rotation is disabled. Default is `false`.

.noZoom : Boolean

Whether or not zooming is disabled. Default is `false`.

.object : Camera

The camera being controlled.

.panSpeed : Number

The pan speed. Default is `0.3`.

.rotateSpeed : Number

The rotation speed. Default is `1.0`.

.screen : Object

Represents the properties of the screen. Automatically set when [page:.handleResize handleResize]() is called.

.staticMoving : Boolean

Whether or not damping is disabled. Default is `false`.

.zoomSpeed : Number

The zoom speed. Default is `1.2`.

Methods

.checkDistances () : undefined

Ensures the controls stay in the range [minDistance, maxDistance]. Called by [page:.update update]().

.dispose () : undefined

Should be called if the controls is no longer required.

.handleResize () : undefined

Should be called if the application window is resized.

.panCamera () : undefined

Performs panning if necessary. Called by [page:.update update]().

.reset () : undefined

Resets the controls to its initial state.

.rotateCamera () : undefined

Rotates the camera if necessary. Called by [page:.update update]().

.update () : undefined

Updates the controls. Usually called in the animation loop.

.zoomCamera () : undefined

Performs zooming if necessary. Called by [page:.update update]().

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/TrackballControls.js examples/jsm/controls/TrackballControls.js]

TrackballControls TrackballControls TrackballControls TrackballControls

TrackballControls TrackballControls TrackballControls TrackballControls