Added normals to the spheres, and improved ProgressiveLoader
This commit is contained in:
29
js/prototype/initScene.js
vendored
29
js/prototype/initScene.js
vendored
@@ -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);
|
||||
// }
|
||||
|
||||
// }
|
||||
// );
|
||||
|
||||
}
|
||||
|
||||
|
||||
4
js/prototype/main.js
vendored
4
js/prototype/main.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user