Capítulo 334 de 859
A special type of helper that visualizes the camera's transformation in a small viewport area as an axes helper. Such a helper is often wanted in 3D modeling tools or scene editors like the three.js editor.
The helper allows to click on the X, Y and Z axes which animates the camera so it looks along the selected axis.
top/bottom for vertical positioning and left/right for horizontal. If `lef…import { ViewHelper } from 'three/addons/helpers/ViewHelper.js';
Constructor
| Signature |
|---|
new ViewHelper( camera : Camera, domElement : HTMLElement ) |
Properties
| Property | Description |
|---|---|
.animating : boolean (readonly) | Whether the helper is currently animating or not. |
.camera : Camera | The camera whose transformation is visualized. It can be reassigned at any time to rebind the helper to a different camera. |
.center : Vector3 | The helper's center point. |
.isViewHelper : boolean (readonly) | This flag can be used for type testing. |
.location : Object | Controls the position of the helper in the viewport. Use top/bottom for vertical positioning and left/right for horizontal. If left is null, right is used. If top is null, bottom … |
Methods
| Method | Description |
|---|---|
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app. |
.handleClick( event : PointerEvent ) : boolean | This method should be called when a click or pointer event has happened in the app. |
| `.render( renderer : WebGLRenderer | WebGPURenderer )` |
.setLabelStyle( font : string, color : string, radius : number ) | Sets the label style. Has no effect when the axes are unlabeled. |
| `.setLabels( labelX : string | undefined, labelY : string |
.update( delta : number ) | Updates the helper. This method should be called in the app's animation loop. |