Changed order in loading...

This commit is contained in:
Thomas FORGIONE 2015-04-15 11:58:54 +02:00
parent 08c6fe1022
commit 618b56bba9
1 changed files with 16 additions and 21 deletions

37
prototype/js/main.js vendored
View File

@ -68,8 +68,22 @@ function init() {
// THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() ); // THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() );
var loader = new THREE.OBJMTLLoader(); var loader = new THREE.OBJMTLLoader();
// loader.load( '/data/castle/princess peaches castle (outside).obj', loader.load( '/data/castle/princess peaches castle (outside).obj',
// '/data/castle/princess peaches castle (outside).mtl', '/data/castle/princess peaches castle (outside).mtl',
function ( object ) {
object.up = new THREE.Vector3(0,0,1);
scene.add(object);
object.traverse(function (object) {
if (object instanceof THREE.Mesh) {
object.geometry.mergeVertices();
if (object.material.name === 'Material.103_princess_peaches_cast') {
console.log(object.material.name);
object.material.transparent = true;
}
}
});
}, onProgress, onError );
loader.load( '/data/first/Floor 1.obj', loader.load( '/data/first/Floor 1.obj',
'/data/first/Floor 1.mtl', '/data/first/Floor 1.mtl',
function ( object ) { function ( object ) {
@ -78,9 +92,7 @@ function init() {
object.position.x += 3.23; object.position.x += 3.23;
var theta = 0.27; var theta = 0.27;
// object.rotation.x = -Math.PI/2;
object.rotation.y = Math.PI - theta; object.rotation.y = Math.PI - theta;
// object.rotation.z = - Math.PI/2;
object.up = new THREE.Vector3(0,0,1); object.up = new THREE.Vector3(0,0,1);
scene.add(object); scene.add(object);
@ -96,23 +108,6 @@ function init() {
}); });
}, onProgress, onError ); }, onProgress, onError );
loader.load( '/data/castle/princess peaches castle (outside).obj',
'/data/castle/princess peaches castle (outside).mtl',
function ( object ) {
// object.rotation.y = Math.PI/2;
// object.rotation.z = Math.PI/2;
object.up = new THREE.Vector3(0,0,1);
scene.add(object);
object.traverse(function (object) {
if (object instanceof THREE.Mesh) {
object.geometry.mergeVertices();
if (object.material.name === 'Material.103_princess_peaches_cast') {
console.log(object.material.name);
object.material.transparent = true;
}
}
});
}, onProgress, onError );
// var camera3 = new FixedCamera( // var camera3 = new FixedCamera(
// 50, // 50,