Inheritance: EventDispatcher → Object3D →
An 3D arrow object for visualizing directions.
const dir = new THREE.Vector3( 1, 2, 0 );
//normalize the direction vector (convert to vector of length 1)
dir.normalize();
const origin = new THREE.Vector3( 0, 0, 0 );
const length = 1;
const hex = 0xffff00;
const arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );
scene.add( arrowHelper );
Constructs a new arrow helper.
dir
The (normalized) direction vector.
Default is (0, 0, 1).
origin
Point at which the arrow starts.
Default is (0, 0, 0).
length
Length of the arrow in world units.
Default is 1.
color
Color of the arrow.
Default is 0xffff00.
headLength
The length of the head of the arrow.
Default is length*0.2.
headWidth
The width of the head of the arrow.
Default is headLength*0.2.
The cone part of the arrow helper.
The line part of the arrow helper.
Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
Sets the color of the helper.
color
The color to set.
Sets the direction of the helper.
dir
The normalized direction vector.
Sets the length of the helper.
length
Length of the arrow in world units.
headLength
The length of the head of the arrow.
Default is length*0.2.
headWidth
The width of the head of the arrow.
Default is headLength*0.2.