Object3D

ArrowHelper

An 3D arrow object for visualizing directions.

Example

WebGL / geometries
WebGL / geometry / normals
WebGL / shadowmesh
var dir = new v3d.Vector3(1, 2, 0); //normalize the direction vector (convert to vector of length 1) dir.normalize(); var origin = new v3d.Vector3(0, 0, 0); var length = 1; var hex = 0xffff00; var arrowHelper = new v3d.ArrowHelper(dir, origin, length, hex); scene.add(arrowHelper);

Constructor

ArrowHelper(dir : Vector3, origin : Vector3, length : Number, hex : Number, headLength : Number, headWidth : Number)

dir -- direction from origin. Must be a unit vector.
origin -- Point at which the arrow starts.
length -- length of the arrow. Default is 1.
hex -- hexadecimal value to define color. Default is 0xffff00.
headLength -- The length of the head of the arrow. Default is 0.2 * length.
headWidth -- The length of the width of the arrow. Default is 0.2 * headLength.

Properties

See the base Object3D class for common properties.

.line : Line

Contains the line part of the arrowHelper.

.cone : Mesh

Contains the cone part of the arrowHelper.

Methods

See the base Object3D class for common methods.

.setColor (hex : Number) : null

hex -- The hexadecimal value of the color.

Sets the color of the arrowHelper.

.setLength (length : Number, headLength : Number, headWidth : Number) : null

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.

.setDirection (dir : Vector3) : null

dir -- The desired direction. Must be a unit vector.

Sets the direction of the arrowhelper.

Source

For more info on how to obtain the source code of this module see this page.