Skip to content

Commit

Permalink
Examples: Simplified webgl_loader_obj_mtl. (#23296)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jan 24, 2022
1 parent f49819b commit d9a9066
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 84 deletions.
Binary file not shown.
Binary file removed examples/models/obj/male02/male-02-1noCulling.dds
Binary file not shown.
30 changes: 15 additions & 15 deletions examples/models/obj/male02/male02.mtl
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
# Material Count: 5
newmtl _01_-_Default1noCulli__01_-_Default1noCulli
Ns 154.901961
Ka 0.000000 0.000000 0.000000
Ns 30.0000
Ka 0.640000 0.640000 0.640000
Kd 0.640000 0.640000 0.640000
Ks 0.165000 0.165000 0.165000
Ks 0.050000 0.050000 0.050000
Ni 1.000000
d 1.000000
illum 2
map_Kd 01_-_Default1noCulling.JPG


newmtl FrontColorNoCullingID_male-02-1noCulling.JP
Ns 154.901961
Ka 0.000000 0.000000 0.000000
Ns 30.0000
Ka 0.800000 0.800000 0.800000
Kd 0.800000 0.800000 0.800000
Ks 0.165000 0.165000 0.165000
Ks 0.050000 0.050000 0.050000
Ni 1.000000
d 1.000000
illum 2
map_Kd male-02-1noCulling.JPG


newmtl male-02-1noCullingID_male-02-1noCulling.JP
Ns 154.901961
Ka 0.000000 0.000000 0.000000
Ns 30.0000
Ka 0.640000 0.640000 0.640000
Kd 0.640000 0.640000 0.640000
Ks 0.165000 0.165000 0.165000
Ks 0.050000 0.050000 0.050000
Ni 1.000000
d 1.000000
illum 2
map_Kd male-02-1noCulling.JPG


newmtl orig_02_-_Defaul1noCu_orig_02_-_Defaul1noCu
Ns 154.901961
Ka 0.000000 0.000000 0.000000
Ns 30.0000
Ka 0.640000 0.640000 0.640000
Kd 0.640000 0.640000 0.640000
Ks 0.165000 0.165000 0.165000
Ks 0.050000 0.050000 0.050000
Ni 1.000000
d 1.000000
illum 2
map_Kd orig_02_-_Defaul1noCulling.JPG


newmtl FrontColorNoCullingID_orig_02_-_Defaul1noCu
Ns 154.901961
Ka 0.000000 0.000000 0.000000
Ns 30.0000
Ka 0.800000 0.800000 0.800000
Kd 0.800000 0.800000 0.800000
Ks 0.165000 0.165000 0.165000
Ks 0.050000 0.050000 0.050000
Ni 1.000000
d 1.000000
illum 2
Expand Down
56 changes: 0 additions & 56 deletions examples/models/obj/male02/male02_dds.mtl

This file was deleted.

Binary file not shown.
Binary file modified examples/screenshots/webgl_loader_obj_mtl.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 4 additions & 13 deletions examples/webgl_loader_obj_mtl.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

import * as THREE from 'three';

import { DDSLoader } from './jsm/loaders/DDSLoader.js';
import { MTLLoader } from './jsm/loaders/MTLLoader.js';
import { OBJLoader } from './jsm/loaders/OBJLoader.js';

Expand Down Expand Up @@ -76,29 +75,21 @@

};

const onError = function () { };

const manager = new THREE.LoadingManager();
manager.addHandler( /\.dds$/i, new DDSLoader() );

// comment in the following line and import TGALoader if your asset uses TGA textures
// manager.addHandler( /\.tga$/i, new TGALoader() );

new MTLLoader( manager )
new MTLLoader()
.setPath( 'models/obj/male02/' )
.load( 'male02_dds.mtl', function ( materials ) {
.load( 'male02.mtl', function ( materials ) {

materials.preload();

new OBJLoader( manager )
new OBJLoader()
.setMaterials( materials )
.setPath( 'models/obj/male02/' )
.load( 'male02.obj', function ( object ) {

object.position.y = - 95;
scene.add( object );

}, onProgress, onError );
}, onProgress );

} );

Expand Down

0 comments on commit d9a9066

Please sign in to comment.