From 365d29bd3dfc686684c64f287410874f1fba56a2 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Thu, 11 Jun 2015 11:38:57 +0200 Subject: [PATCH] init scene is now cool with sponza --- js/prototype/initScene.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/prototype/initScene.js b/js/prototype/initScene.js index c6f49bb..5d3ecd5 100644 --- a/js/prototype/initScene.js +++ b/js/prototype/initScene.js @@ -768,20 +768,26 @@ function initSponzaScene(scene, collidableObjects, loader, static_path) { object.scale.set(0.01,0.01,0.01); object.raycastable = true; collidableObjects.push(object); - console.log(object); - scene.add(object); // object.rotation.x = -Math.PI/2; // object.rotation.z = Math.PI/2; // collidableObjects.push(object); // scene.add(object); object.traverse(function (obj) { - // if (obj instanceof THREE.Mesh) { + if (obj instanceof THREE.Mesh) { + for (var i in obj.material.materials) { + var m = obj.material.materials[i].map; + if (m) + m.wrapS = m.wrapT = THREE.RepeatWrapping; + } + // obj.material.map.wrapS = obj.material.map.wrapT = THREE.RepeatWrapping; + } // obj.geometry.mergeVertices(); // obj.geometry.computeVertexNormals(); // obj.material.side = THREE.DoubleSide; // obj.raycastable = true; // } }); + scene.add(object); } , onProgress, function(xhr) { console.log("error");}); }