Browse Source

Merge remote-tracking branch 'timknip/master' into dev

Mr.doob 14 years ago
parent
commit
a1a54764b5
2 changed files with 10 additions and 9 deletions
  1. 7 6
      examples/webgl_collada.html
  2. 3 3
      src/extras/collada/dae.js

+ 7 - 6
examples/webgl_collada.html

@@ -86,16 +86,17 @@
 
 				// Lights
 
-				scene.addLight( new THREE.AmbientLight( 0xaaaaaa) );
+				scene.addLight( new THREE.AmbientLight( 0xcccccc) );
 
-				var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xbbbbbb);
+				var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xeeeeee);
 				directionalLight.position.x = Math.random() - 0.5;
 				directionalLight.position.y = Math.random() - 0.5;
 				directionalLight.position.z = Math.random() - 0.5;
 				directionalLight.position.normalize();
 				scene.addLight( directionalLight );
 
-				pointLight = new THREE.PointLight( 0xdddddd, 0.6 );
+				pointLight = new THREE.PointLight( 0xffffff , 4);
+				pointLight.position.x = 10000;
 				scene.addLight( pointLight );
 
 				renderer = new THREE.WebGLRenderer();
@@ -140,9 +141,9 @@
 				camera.position.y = 2;
 				camera.position.z = Math.sin( timer ) * 10;
 
-				particleLight.position.x = Math.sin( timer * 4 ) * 300;
-				particleLight.position.y = Math.cos( timer * 5 ) * 400;
-				particleLight.position.z = Math.cos( timer * 4 ) * 300;
+				particleLight.position.x = Math.sin( timer * 4 ) * 3009;
+				particleLight.position.y = Math.cos( timer * 5 ) * 4000;
+				particleLight.position.z = Math.cos( timer * 4 ) * 3009;
 
 				pointLight.position.x = particleLight.position.x;
 				pointLight.position.y = particleLight.position.y;

+ 3 - 3
src/extras/collada/dae.js

@@ -267,7 +267,7 @@ var DAE = (function() {
 				var inv = skin.invBindMatrices[found];
 				bone.invBindMatrix = inv;
 				bone.skinningMatrix = new THREE.Matrix4();
-				bone.skinningMatrix.multiply(bone.world, inv);
+				bone.skinningMatrix.multiply(bone.world, inv); // (IBMi * JMi)
 				bone.weights = [];
 				for (var j = 0; j < skin.weights.length; j++) {
 					for (var k = 0; k < skin.weights[j].length; k++) {
@@ -1225,7 +1225,7 @@ var DAE = (function() {
 							ns.push(new THREE.Vector3(source.data[idx32+0], source.data[idx32+1], source.data[idx32+2]));
 							break;
 						case 'TEXCOORD':
-							if (ts[input.set] == undefined) ts[input.set] = [];
+							if (ts[input.set] === undefined) ts[input.set] = [];
 							ts[input.set].push(new THREE.UV(source.data[idx32+0], source.data[idx32+1]));
 							break;
 						default:
@@ -1568,7 +1568,7 @@ var DAE = (function() {
 			case 'blinn':
 			default:
 				if (!transparent) {
-					this.material = new THREE.MeshPhongMaterial(props);
+				//	this.material = new THREE.MeshPhongMaterial(props);
 				}
 				break;
 		}