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 );
[example:webgl_shadowmesh WebGL / shadowmesh]
[page:Vector3 dir] -- direction from origin. Must be a unit vector.
[page:Vector3 origin] -- Point at which the arrow starts.
[page:Number length] -- length of the arrow. Default is *1*.
[page:Number hex] -- hexadecimal value to define color. Default is 0xffff00.
[page:Number headLength] -- The length of the head of the arrow. Default is 0.2 * length.
[page:Number headWidth] -- The width of the head of the arrow. Default is 0.2 * headLength.
See the base [page:Object3D] class for common properties.
Contains the line part of the arrowHelper.
Contains the cone part of the arrowHelper.
See the base [page:Object3D] class for common methods.
color -- The desired color.
Sets the color of the arrowHelper.
length -- The desired length.
headLength -- The length of the head of the arrow.
headWidth -- The width of the head of the arrow.
Sets the length of the arrowhelper.
dir -- The desired direction. Must be a unit vector.
Sets the direction of the arrowhelper.