1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- /**
- * @author alteredq / http://alteredqualia.com/
- * @author mrdoob / http://mrdoob.com/
- */
- THREE.PointLightHelper = function ( light, sphereSize ) {
- THREE.Object3D.call( this );
- this.matrixAutoUpdate = false;
- this.light = light;
- var geometry = new THREE.SphereGeometry( sphereSize, 4, 2 );
- var material = new THREE.MeshBasicMaterial( { fog: false, wireframe: true } );
- material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
- this.lightSphere = new THREE.Mesh( geometry, material );
- this.lightSphere.matrixWorld = this.light.matrixWorld;
- this.lightSphere.matrixAutoUpdate = false;
- this.add( this.lightSphere );
- /*
- var distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );
- var distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );
- this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );
- this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );
- var d = light.distance;
- if ( d === 0.0 ) {
- this.lightDistance.visible = false;
- } else {
- this.lightDistance.scale.set( d, d, d );
- }
- this.add( this.lightDistance );
- */
- };
- THREE.PointLightHelper.prototype = Object.create( THREE.Object3D.prototype );
- THREE.PointLightHelper.prototype.update = function () {
- this.lightSphere.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
- /*
- this.lightDistance.material.color.copy( this.color );
- var d = this.light.distance;
- if ( d === 0.0 ) {
- this.lightDistance.visible = false;
- } else {
- this.lightDistance.visible = true;
- this.lightDistance.scale.set( d, d, d );
- }
- */
- };
|