|
@@ -52,9 +52,9 @@
|
|
|
Detector.addGetWebGLMessage();
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
+ /*
|
|
|
|
|
|
- Simple demo for loading json files generated by assimp2json
|
|
|
+ Simple demo for loading json files generated by assimp2json
|
|
|
https://github.com/acgessler/assimp2json
|
|
|
|
|
|
assimp2json uses assimp (http://assimp.sf.net) to import 40+ 3D file
|
|
@@ -92,22 +92,18 @@
|
|
|
|
|
|
// Load jeep model using the AssimpJSONLoader
|
|
|
var loader1 = new THREE.AssimpJSONLoader();
|
|
|
- loader1.load( 'models/assimp/jeep/jeep.assimp.json', function ( assimpjson ) {
|
|
|
+ loader1.load( 'models/assimp/jeep/jeep.assimp.json', function ( object ) {
|
|
|
|
|
|
- assimpjson.scale.x = assimpjson.scale.y = assimpjson.scale.z = 0.2;
|
|
|
- assimpjson.updateMatrix();
|
|
|
+ object.scale.multiplyScalar( 0.2 );
|
|
|
+ scene.add( object );
|
|
|
|
|
|
- scene.add(assimpjson);
|
|
|
}, onProgress, onError );
|
|
|
|
|
|
// load interior model
|
|
|
var loader2 = new THREE.AssimpJSONLoader();
|
|
|
- loader2.load( 'models/assimp/interior/interior.assimp.json', function ( assimpjson ) {
|
|
|
+ loader2.load( 'models/assimp/interior/interior.assimp.json', function ( object ) {
|
|
|
|
|
|
- assimpjson.scale.x = assimpjson.scale.y = assimpjson.scale.z = 1;
|
|
|
- assimpjson.updateMatrix();
|
|
|
-
|
|
|
- scene.add( assimpjson );
|
|
|
+ scene.add( object );
|
|
|
|
|
|
}, onProgress, onError );
|
|
|
|
|
@@ -130,9 +126,9 @@
|
|
|
// Lights
|
|
|
scene.add( new THREE.AmbientLight( 0xcccccc ) );
|
|
|
|
|
|
- var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xeeeeee );
|
|
|
+ var directionalLight = new THREE.DirectionalLight( 0xeeeeee );
|
|
|
directionalLight.position.x = Math.random() - 0.5;
|
|
|
- directionalLight.position.y = Math.random() - 0.5;
|
|
|
+ directionalLight.position.y = Math.random();
|
|
|
directionalLight.position.z = Math.random() - 0.5;
|
|
|
directionalLight.position.normalize();
|
|
|
scene.add( directionalLight );
|