Browse Source

put light on camera

Gregg Tavares 6 years ago
parent
commit
069e7e17ed

+ 1 - 1
threejs/threejs-picking-gpu.html

@@ -53,7 +53,7 @@ function main() {
     const intensity = 1;
     const light = new THREE.DirectionalLight(color, intensity);
     light.position.set(-1, 2, 4);
-    scene.add(light);
+    camera.add(light);
   }
 
   const boxWidth = 1;

+ 1 - 1
threejs/threejs-picking-raycaster-complex-geo.html

@@ -51,7 +51,7 @@ function main() {
     const intensity = 1;
     const light = new THREE.DirectionalLight(color, intensity);
     light.position.set(-1, 2, 4);
-    scene.add(light);
+    camera.add(light);
   }
 
   const geometry = new THREE.SphereBufferGeometry(.6, 100, 100);

+ 1 - 1
threejs/threejs-picking-raycaster-transparency.html

@@ -51,7 +51,7 @@ function main() {
     const intensity = 1;
     const light = new THREE.DirectionalLight(color, intensity);
     light.position.set(-1, 2, 4);
-    scene.add(light);
+    camera.add(light);
   }
 
   const boxWidth = 1;

+ 1 - 1
threejs/threejs-picking-raycaster.html

@@ -50,7 +50,7 @@ function main() {
     const intensity = 1;
     const light = new THREE.DirectionalLight(color, intensity);
     light.position.set(-1, 2, 4);
-    scene.add(light);
+    camera.add(light);
   }
 
   const boxWidth = 1;