12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /**
- * @author sroucheray / http://sroucheray.org/
- * @author mr.doob / http://mrdoob.com/
- */
- THREE.AxisHelper = function () {
- THREE.Object3D.call( this );
- var lineGeometry = new THREE.Geometry();
- lineGeometry.vertices.push( new THREE.Vector3() );
- lineGeometry.vertices.push( new THREE.Vector3( 0, 100, 0 ) );
- var coneGeometry = new THREE.CylinderGeometry( 0, 5, 25, 5, 1 );
- var line, cone;
- // x
- line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color : 0xff0000 } ) );
- line.rotation.z = - Math.PI / 2;
- this.add( line );
- cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color : 0xff0000 } ) );
- cone.position.x = 100;
- cone.rotation.z = - Math.PI / 2;
- this.add( cone );
- // y
- line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color : 0x00ff00 } ) );
- this.add( line );
- cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color : 0x00ff00 } ) );
- cone.position.y = 100;
- this.add( cone );
- // z
- line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color : 0x0000ff } ) );
- line.rotation.x = Math.PI / 2;
- this.add( line );
- cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color : 0x0000ff } ) );
- cone.position.z = 100;
- cone.rotation.x = Math.PI / 2;
- this.add( cone );
- };
- THREE.AxisHelper.prototype = new THREE.Object3D();
- THREE.AxisHelper.prototype.constructor = THREE.AxisHelper;
|