Ver código fonte

Updated 3ds example

Tentone 8 anos atrás
pai
commit
f0c421d523

+ 1 - 1
examples/js/loaders/TDSLoader.js

@@ -14,7 +14,7 @@
 THREE.TDSLoader = function ( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
-	this.debug = true;
+	this.debug = false;
 
 	this.group = null;
 	this.position = 0;

BIN
examples/models/3ds/portalgun/portalgun.3ds


+ 0 - 0
examples/models/3ds/portalgun/textures/portalgun_co.jpg → examples/models/3ds/portalgun/textures/color.jpg


+ 0 - 0
examples/models/3ds/portalgun/textures/portalgun_no.jpg → examples/models/3ds/portalgun/textures/normal.jpg


+ 4 - 5
examples/webgl_loader_3ds.html

@@ -59,9 +59,9 @@
 				directionalLight.position.set( 0, 0, 2 );
 				scene.add( directionalLight );
 
-				//var loader = new THREE.TextureLoader();
-				//var texture = loader.load( 'models/3ds/portalgun/textures/color.jpg' );
-				//var normal = loader.load( 'models/3ds/portalgun/textures/normal.jpg' );
+				//3ds files dont store normal maps
+				var loader = new THREE.TextureLoader();
+				var normal = loader.load( 'models/3ds/portalgun/textures/normal.jpg' );
 
 				var loader = new THREE.TDSLoader( );
 				loader.setPath( 'models/3ds/portalgun/textures/' );
@@ -71,8 +71,7 @@
 
 						if ( child instanceof THREE.Mesh ) {
 
-							//child.material.map = texture;
-							//child.material.normalMap = normal;
+							child.material.normalMap = normal;
 						}
 
 					} );