Do not load bob omb level

This commit is contained in:
Thomas FORGIONE 2015-04-27 14:59:27 +02:00
parent 83eb04b31c
commit 0386263d58
1 changed files with 51 additions and 51 deletions

View File

@ -175,64 +175,64 @@ function init() {
}); });
}, onProgress, onError ); }, onProgress, onError );
loader.load( static_path + 'data/bobomb/bobomb battlefeild.obj', // loader.load( static_path + 'data/bobomb/bobomb battlefeild.obj',
static_path + 'data/bobomb/bobomb battlefeild.mtl', // static_path + 'data/bobomb/bobomb battlefeild.mtl',
function ( object ) { // function ( object ) {
// object.position.z -= 10.9; // // object.position.z -= 10.9;
// object.position.y += 0.555; // // object.position.y += 0.555;
// object.position.x += 3.23; // // object.position.x += 3.23;
var theta = 0.27; // var theta = 0.27;
object.rotation.y = Math.PI - theta; // object.rotation.y = Math.PI - theta;
object.up = new THREE.Vector3(0,0,1); // object.up = new THREE.Vector3(0,0,1);
collidableObjects.push(object); // collidableObjects.push(object);
scene.add(object); // scene.add(object);
object.traverse(function (object) { // object.traverse(function (object) {
if (object instanceof THREE.Mesh) { // if (object instanceof THREE.Mesh) {
object.material.side = THREE.DoubleSide; // object.material.side = THREE.DoubleSide;
console.log(object.geometry.vertices.length); // console.log(object.geometry.vertices.length);
object.geometry.mergeVertices(); // object.geometry.mergeVertices();
object.geometry.computeVertexNormals(); // object.geometry.computeVertexNormals();
if (object.material.name === 'Material.071_574B138E_c.bmp' || // if (object.material.name === 'Material.071_574B138E_c.bmp' ||
object.material.name === 'Material.070_41A41EE3_c.bmp') { // object.material.name === 'Material.070_41A41EE3_c.bmp') {
object.material.transparent = true; // object.material.transparent = true;
} // }
} // }
}); // });
}, onProgress, onError ); // }, onProgress, onError );
loader.load( static_path + 'data/star/GrandStar.obj', // loader.load( static_path + 'data/star/GrandStar.obj',
static_path + 'data/star/GrandStar.mtl', // static_path + 'data/star/GrandStar.mtl',
function ( object ) { // function ( object ) {
object.position.z -= 10.9; // object.position.z -= 10.9;
object.position.y += 0.555; // object.position.y += 0.555;
object.position.x += 3.23; // object.position.x += 3.23;
var theta = 0.27; // var theta = 0.27;
object.rotation.y = Math.PI - theta; // object.rotation.y = Math.PI - theta;
object.up = new THREE.Vector3(0,0,1); // object.up = new THREE.Vector3(0,0,1);
scene.add(object); // scene.add(object);
collidableObjects.push(object); // collidableObjects.push(object);
object.traverse(function (object) { // object.traverse(function (object) {
if (object instanceof THREE.Mesh) { // if (object instanceof THREE.Mesh) {
object.scale.set(0.005,0.005,0.005); // object.scale.set(0.005,0.005,0.005);
object.position.x = 13; // object.position.x = 13;
object.position.z = -35; // object.position.z = -35;
object.position.y = 30; // object.position.y = 30;
object.rotation.z = Math.PI/2; // object.rotation.z = Math.PI/2;
object.rotation.x = Math.PI/2; // object.rotation.x = Math.PI/2;
object.rotation.y = Math.PI; // object.rotation.y = Math.PI;
object.material.side = THREE.DoubleSide; // object.material.side = THREE.DoubleSide;
object.geometry.mergeVertices(); // object.geometry.mergeVertices();
object.geometry.computeVertexNormals(); // object.geometry.computeVertexNormals();
object.raycastable = true; // object.raycastable = true;
} // }
}); // });
}, onProgress, onError ); // }, onProgress, onError );
createCamera( createCamera(
new THREE.Vector3(-3.349895207953063, 5.148106346852601, 0.3365943929701533), new THREE.Vector3(-3.349895207953063, 5.148106346852601, 0.3365943929701533),