File: TransformControls.md | Updated: 11/15/2025
This class can be used to transform objects in 3D space by adapting a similar interaction model of DCC tools like Blender. Unlike other controls, it is not intended to transform the scene's camera.
TransformControls expects that its attached 3D object is part of the scene graph.
TransformControls is an addon, and must be imported explicitly, see Installation#Addons.
import { TransformControls } from 'three/addons/controls/TransformControls.js';
Constructs a new controls instance.
camera | The camera of the rendered scene.
---|---
domElement | The HTML element used for event listeners. Default is null.
The current transformation axis.
The camera of the rendered scene.
Whether dragging is currently performed or not.
Default is false.
The maximum allowed X position during translation.
Default is Infinity.
The maximum allowed Y position during translation.
Default is Infinity.
The maximum allowed Z position during translation.
Default is Infinity.
The minimum allowed X position during translation.
Default is -Infinity.
The minimum allowed y position during translation.
Default is -Infinity.
The minimum allowed z position during translation.
Default is -Infinity.
The current transformation axis.
Default is 'translate'.
By default, 3D objects are continuously rotated. If you set this property to a numeric value (radians), you can define in which steps the 3D object should be rotated.
Default is null.
By default, 3D objects are continuously scaled. If you set this property to a numeric value, you can define in which steps the 3D object should be scaled.
Default is null.
Whether the x-axis helper should be visible or not.
Default is true.
Whether the y-axis helper should be visible or not.
Default is true.
Whether the z-axis helper should be visible or not.
Default is true.
The size of the helper UI (axes/planes).
Default is 1.
Defines in which coordinate space transformations should be performed.
Default is 'world'.
By default, 3D objects are continuously translated. If you set this property to a numeric value (world units), you can define in which steps the 3D object should be translated.
Default is null.
Sets the 3D object that should be transformed and ensures the controls UI is visible.
object | The 3D object that should be transformed.
---|---
Returns: A reference to this controls.
Removes the current 3D object from the controls and makes the helper UI invisible.
Returns: A reference to this controls.
Returns the visual representation of the controls. Add the helper to your scene to visually transform the attached 3D object.
Returns: The helper.
Returns the transformation mode.
Returns: The transformation mode.
Returns the raycaster that is used for user interaction. This object is shared between all instances of TransformControls.
Returns: The internal raycaster.
Resets the object's position, rotation and scale to when the current transform began.
Sets the colors of the control's gizmo.
xAxis | The x-axis color.
---|---
yAxis | The y-axis color.
zAxis | The z-axis color.
active | The color for active elements.
Sets the given transformation mode.
mode | The transformation mode to set.
---|---
Sets the rotation snap.
rotationSnap | The rotation snap to set.
---|---
Sets the scale snap.
scaleSnap | The scale snap to set.
---|---
Sets the size of the helper UI.
size | The size to set.
---|---
Sets the coordinate space in which transformations are applied.
space | The space to set.
---|---
Sets the translation snap.
translationSnap | The translation snap to set.
---|---
Fires if any type of change (object or property change) is performed. Property changes are separate events you can add event listeners to. The event type is "propertyname-changed".
Fires if a pointer (mouse/touch) becomes active.
Fires if a pointer (mouse/touch) is no longer active.
Fires if the controlled 3D object is changed.