[page:Object3D] →
[name]
An 3D arrow Object.
Example
var dir = new THREE.Vector3( 1, 0, 0 );
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]([page:Vector3 dir], [page:Vector3 origin], [page:Number length], [page:Number hex], [page:Number headLength], [page:Number headWidth] )
dir -- Vector3 -- direction from origin. Must be a unit vector.
origin -- Vector3
length -- scalar
hex -- hexadecimal value to define color ex:0xffff00
headLength -- The length of the head of the arrow
headWidth -- The length of the width of the arrow
This creates an arrow starting in origin in the direction dir for a certain length. It is also possible to change color.
Properties
[property:Line line]
Contains the line part of the arrowHelper.
[property:Mesh cone]
Contains the cone part of the arrowHelper.
Methods
[method:null setColor]([page:Number hex])
hex -- The hexadicmal value of the color
Sets the color of the arrowHelper.
[method:null setLength]([page:Number length], [page:Number headLength], [page: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]([page: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]