[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
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
.[page:Line line]
Contains the line part of the arrowHelper.
.[page:Mesh cone]
Contains the cone part of the arrowHelper.
Methods
.setColor([page:Number hex])
hex -- The hexadicmal value of the color
Sets the color of the arrowHelper.
.setLength([page:Number length])
length -- The desired length
Sets the length of the arrowhelper.
.setDirection([page:vector3 dir])
dir -- The desired direction in euler format.
Sets the direction of the arrowhelper.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]