From f465ace7b4f98b4658563e25a8d17aff75f66fe7 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 8 Apr 2015 15:42:28 +0200 Subject: [PATCH] Corrected bug --- scene/js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/js/main.js b/scene/js/main.js index ffe6ecb..333555a 100644 --- a/scene/js/main.js +++ b/scene/js/main.js @@ -19,7 +19,7 @@ function init() { container = document.getElementById('container'); container.style.height = container_size.height + 'px'; container.style.width = container_size.width + 'px'; - renderer = new THREE.WebGLRenderer({alpha:"true"}); + renderer = new THREE.WebGLRenderer({alpha:true}); renderer.setSize(container_size.width, container_size.height); renderer.shadowMapEnabled = true; // renderer.setClearColor(0x000000); @@ -130,7 +130,7 @@ function loadScene() { // I am pretty good (function(i) { var new_id; - loader.load('/data/spheres/' + (i+1) + '.obj', function (object) { + loader.load('/data/spheres/' + (2*i+2) + '.obj', function (object) { object.traverse(function (child) { if (child instanceof THREE.Mesh ) { child.material.color.setHex(colors[i]); @@ -216,7 +216,7 @@ function click(event) { // Looking for objects for (o in objects) { - if ( intersects[bestIndex].object.id == objects[o].id) { + if ( intersects[bestIndex].object.id == objects[o].id && cameras.get(objects[o].seen_by[0]) !== undefined) { cameras.get(0).move(cameras.get(objects[o].seen_by[0])); break; }