Browse Source

Added light objects

Nicolas Garcia Belmonte 15 years ago
parent
commit
d342239c4a
3 changed files with 23 additions and 0 deletions
  1. 8 0
      src/lights/AmbientLight.js
  2. 10 0
      src/lights/DirectionalLight.js
  3. 5 0
      src/lights/Light.js

+ 8 - 0
src/lights/AmbientLight.js

@@ -0,0 +1,8 @@
+THREE.AmbientLight = function(color) {
+  
+  THREE.Light.call(this, color);
+
+};
+
+THREE.AmbientLight.prototype = new THREE.Light();
+THREE.AmbientLight.prototype.constructor = THREE.AmbientLight; 

+ 10 - 0
src/lights/DirectionalLight.js

@@ -0,0 +1,10 @@
+THREE.DirectionalLight = function(color, direction) {
+  
+  THREE.Light.call(this, color);
+  
+  this.direction = direction || new Vector3(1, 1, 1);
+
+};
+
+THREE.DirectionalLight.prototype = new THREE.Light();
+THREE.DirectionalLight.prototype.constructor = THREE.DirectionalLight; 

+ 5 - 0
src/lights/Light.js

@@ -0,0 +1,5 @@
+THREE.Light = function(color) {
+
+  this.color = color;
+
+};