提交 bd42e88e 编写于 作者: S srifqi

Update ArrowHelper.js

changed hex to color
上级 f2185308
...@@ -9,18 +9,18 @@ ...@@ -9,18 +9,18 @@
* dir - Vector3 * dir - Vector3
* origin - Vector3 * origin - Vector3
* length - Number * length - Number
* hex - color in hex value * color - color in hex value
* headLength - Number * headLength - Number
* headWidth - Number * headWidth - Number
*/ */
THREE.ArrowHelper = function ( dir, origin, length, hex, headLength, headWidth ) { THREE.ArrowHelper = function ( dir, origin, length, color, headLength, headWidth ) {
// dir is assumed to be normalized // dir is assumed to be normalized
THREE.Object3D.call( this ); THREE.Object3D.call( this );
if ( hex === undefined ) hex = 0xffff00; if ( color === undefined ) color = 0xffff00;
if ( length === undefined ) length = 1; if ( length === undefined ) length = 1;
if ( headLength === undefined ) headLength = 0.2 * length; if ( headLength === undefined ) headLength = 0.2 * length;
if ( headWidth === undefined ) headWidth = 0.2 * headLength; if ( headWidth === undefined ) headWidth = 0.2 * headLength;
...@@ -31,14 +31,14 @@ THREE.ArrowHelper = function ( dir, origin, length, hex, headLength, headWidth ) ...@@ -31,14 +31,14 @@ THREE.ArrowHelper = function ( dir, origin, length, hex, headLength, headWidth )
lineGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ) ); lineGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
lineGeometry.vertices.push( new THREE.Vector3( 0, 1, 0 ) ); lineGeometry.vertices.push( new THREE.Vector3( 0, 1, 0 ) );
this.line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color: hex } ) ); this.line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color: color } ) );
this.line.matrixAutoUpdate = false; this.line.matrixAutoUpdate = false;
this.add( this.line ); this.add( this.line );
var coneGeometry = new THREE.CylinderGeometry( 0, 0.5, 1, 5, 1 ); var coneGeometry = new THREE.CylinderGeometry( 0, 0.5, 1, 5, 1 );
coneGeometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, - 0.5, 0 ) ); coneGeometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, - 0.5, 0 ) );
this.cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color: hex } ) ); this.cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color: color } ) );
this.cone.matrixAutoUpdate = false; this.cone.matrixAutoUpdate = false;
this.add( this.cone ); this.add( this.cone );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册