Object3D

ArrowHelper

An 3D arrow object for visualizing directions.

Code Example

const dir = new v3d.Vector3(1, 2, 0); // normalize the direction vector (convert to vector of length 1) dir.normalize(); const origin = new v3d.Vector3(0, 0, 0); const length = 1; const hex = 0xffff00; const arrowHelper = new v3d.ArrowHelper(dir, origin, length, hex); app.scene.add(arrowHelper);

Constructor

ArrowHelper(dir : Vector3, origin : Vector3, length : Float, color : Color | Integer | String, headLength : Float, headWidth : Float)

Properties

See the base Object3D class for common properties.

.line : Line

Contains the line part of the arrow helper.

.cone : Mesh

Contains the cone part of the arrow helper.

Methods

See the base Object3D class for common methods.

.setColor(color : Color)

color — the desired color.

Sets the color of the arrow helper.

.setLength(length : Float, headLength : Float, headWidth : Float)

Sets the length of the arrow helper.

.setDirection(dir : Vector3)

dir — the desired direction. Must be a unit vector.

Sets the direction of the arrow helper.

.dispose()

Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.

Source

For more info on how to obtain the source code of this module see this page.