|
637 | 637 |
|
638 | 638 | // only use a single point light |
639 | 639 |
|
640 | | - lights[ 0 ].visible = false; |
641 | | - lights[ 2 ].visible = false; |
| 640 | + light1.visible = false; |
| 641 | + light3.visible = false; |
642 | 642 |
|
643 | 643 | return material; |
644 | 644 |
|
|
718 | 718 | const ambientLight = new THREE.AmbientLight( 0x000000 ); |
719 | 719 | scene.add( ambientLight ); |
720 | 720 |
|
721 | | - const lights = []; |
722 | | - lights[ 0 ] = new THREE.PointLight( 0xffffff, 1, 0 ); |
723 | | - lights[ 1 ] = new THREE.PointLight( 0xffffff, 1, 0 ); |
724 | | - lights[ 2 ] = new THREE.PointLight( 0xffffff, 1, 0 ); |
| 721 | + const light1 = new THREE.PointLight( 0xffffff, 1, 0 ); |
| 722 | + light1.position.set( 0, 200, 0 ); |
| 723 | + scene.add( light1 ); |
725 | 724 |
|
726 | | - lights[ 0 ].position.set( 0, 200, 0 ); |
727 | | - lights[ 1 ].position.set( 100, 200, 100 ); |
728 | | - lights[ 2 ].position.set( - 100, - 200, - 100 ); |
| 725 | + const light2 = new THREE.PointLight( 0xffffff, 1, 0 ); |
| 726 | + light2.position.set( 100, 200, 100 ); |
| 727 | + scene.add( light2 ); |
729 | 728 |
|
730 | | - scene.add( lights[ 0 ] ); |
731 | | - scene.add( lights[ 1 ] ); |
732 | | - scene.add( lights[ 2 ] ); |
| 729 | + const light3 = new THREE.PointLight( 0xffffff, 1, 0 ); |
| 730 | + light3.position.set( - 100, - 200, - 100 ); |
| 731 | + scene.add( light3 ); |
733 | 732 |
|
734 | 733 | guiScene( gui, scene, camera ); |
735 | 734 |
|
|
0 commit comments