Added normals to the spheres, and improved ProgressiveLoader

This commit is contained in:
Thomas FORGIONE
2015-06-16 12:05:29 +02:00
parent f89e52dc5a
commit c6062e6a50
30 changed files with 90117 additions and 45613 deletions

View File

@@ -600,21 +600,26 @@ function initMountain(camera, scene, static_path, coins) {
function initSponzaScene(scene, collidableObjects, loader, static_path) {
ProgressiveLoader('/static/data/sponza/sponza.obj', scene,
function(obj) {
obj.scale.set(0.1,0.1,0.1);
collidableObjects.push(obj);
obj.raycastable = true;
var loader = new ProgressiveLoader('static/data/sponza/sponza.obj', scene);
loader.load();
glob = loader.obj;
loader.obj.scale.set(0.1,0.1,0.1);
if (obj.material.name === 'chain' ||
obj.material.name === 'leaf' ||
obj.material.name === 'Material__57') {
// ProgressiveLoader('/static/data/sponza/sponza.obj', scene,
// function(obj) {
// obj.scale.set(0.1,0.1,0.1);
// collidableObjects.push(obj);
// obj.raycastable = true;
THREEx.Transparency.push(obj);
}
// if (obj.material.name === 'chain' ||
// obj.material.name === 'leaf' ||
// obj.material.name === 'Material__57') {
}
);
// THREEx.Transparency.push(obj);
// }
// }
// );
}

View File

@@ -76,7 +76,7 @@ function init() {
container.appendChild(renderer.domElement);
// Initialize pointer camera
var camera1 = new PointerCamera(50, container_size.width() / container_size.height(), 0.1, 100000, renderer, container);
var camera1 = new PointerCamera(50, container_size.width() / container_size.height(), 0.01, 100000, renderer, container);
cameras = initMainScene(camera1, scene, static_path, coins);
// cameras = initPeach(camera1, scene, static_path, coins);
@@ -143,7 +143,7 @@ function render() {
// Set current position of camera
// cameras.look();
cameras.look();
// var left = 0, bottom = 0, width = container_size.width(), height = container_size.height();
// renderer.setScissor(left, bottom, width, height);