Skip to content

NgtsTransformControls

NgtsTransformControls provides interactive transform controls for manipulating 3D objects. It wraps Three.js TransformControls to provide translation, rotation, and scaling gizmos.

Usage

import { NgtsTransformControls } from 'angular-three-soba/gizmos';

Wrap content directly:

<ngts-transform-controls [options]="{ mode: 'translate' }">
<ngt-mesh>
<ngt-box-geometry />
<ngt-mesh-standard-material />
</ngt-mesh>
</ngts-transform-controls>

Or attach to an existing object:

<ngts-transform-controls
[object]="meshRef"
[options]="{ mode: 'rotate', showX: false }"
(change)="onTransform($event)"
/>

Outputs

name type description
change any Emits on any transformation change.
mouseDown any Emits when mouse is pressed on gizmo.
mouseUp any Emits when mouse is released.
objectChange any Emits when the object's transform changes.

Options

Properties

name type description
object Object3D The target object to transform (optional). Can also wrap content directly.
enabled boolean Whether the controls are enabled. Default: true
mode 'translate' | 'rotate' | 'scale' The transformation mode. Default: 'translate'
axis 'X' | 'Y' | 'Z' | 'XY' | 'YZ' | 'XZ' | 'XYZ' | null Restricts transformation to specific axis. Default: null
space 'world' | 'local' Coordinate space for transformations. Default: 'world'
size number Size of the gizmo. Default: 1
showX boolean Whether to show the X axis handle. Default: true
showY boolean Whether to show the Y axis handle. Default: true
showZ boolean Whether to show the Z axis handle. Default: true
translationSnap number Snap increment for translation. Default: null
rotationSnap number Snap increment for rotation in radians. Default: null
scaleSnap number Snap increment for scaling. Default: null
makeDefault boolean Whether to make these the default controls. Default: false