ArrowHelper 箭头助手

—> Object3D

用于可视化方向的3D箭头。

function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { } var direction = new THREE.Vector3( 0, 0, 1), direction2 = new THREE.Vector3( 1, 0, 1), origin = new THREE.Vector3( 0, 0, 0), origin2 = new THREE.Vector3( 1, 1, 1); var helper = new THREE.ArrowHelper( direction, origin, 8, 0xffff00, 1, 0.5), helper2 = new THREE.ArrowHelper( direction2, origin2, 12, 0xff0000, 1, 2 ); scene.add(helper); scene.add(helper2);

Constructor

dir origin length color headLength headWidth
Vector3( 0, 0, 1 ) Vector3( 0, 0, 0 ) 1 0xffff00 0.2 * length 0.2 * headLength
方向 原点 线段长度 颜色 箭头长度 箭头宽度

Attributes

line : Line

Default value : new Line( lineGeometry, new LineBasicMaterial( { color: color } ) );
Description : 箭头中的线。

cone : Mesh

Default value : new Mesh( coneGeometry, new MeshBasicMaterial( { color: color } ) );
Description : 箭头中的圆锥。

Methods

setColor( color ) : null
color Hexadecimal value 十六进制的颜色值

设置箭头的颜色。

setDirection( dir ) : null
dir Vector3 方向向量

设置箭头的方向。

setLength( length, headLength, headWidth ) : null
length Number 线段长度
headLength Number 箭头长度
headWidth Number 箭头宽度

设置箭头的长度。