[page:Object3D] →
[name]
An 3D arrow object for visualizing directions.
Example
[example:webgl_geometries WebGL / geometries]
[example:webgl_geometry_normals WebGL / geometry / normals]
[example:webgl_shadowmesh WebGL / shadowmesh]
var dir = new THREE.Vector3( 1, 2, 0 );
//normalize the direction vector (convert to vector of length 1)
dir.normalize();
var origin = new THREE.Vector3( 0, 0, 0 );
var length = 1;
var hex = 0xffff00;
var arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );
scene.add( arrowHelper );
Constructor
[name]([param:Vector3 dir], [param:Vector3 origin], [param:Number length], [param:Number hex], [param:Number headLength], [param:Number headWidth] )
[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 length of the width of the arrow. Default is 0.2 * headLength.
Properties
See the base [page:Object3D] class for common properties.
[property:Line line]
Contains the line part of the arrowHelper.
[property:Mesh cone]
Contains the cone part of the arrowHelper.
Methods
See the base [page:Object3D] class for common methods.
[method:null setColor]([param:Number hex])
hex -- The hexadecimal value of the color.
Sets the color of the arrowHelper.
[method:null setLength]([param:Number length], [param:Number headLength], [param:Number headWidth])
length -- The desired length.
headLength -- The length of the head of the arrow.
headWidth -- The length of the width of the arrow.
Sets the length of the arrowhelper.
[method:null setDirection]([param:Vector3 dir])
dir -- The desired direction. Must be a unit vector.
Sets the direction of the arrowhelper.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]