diff --git a/data/castle/princess peaches castle (outside).mtl b/data/castle/princess peaches castle (outside).mtl index 2a6727a..8801d18 100644 --- a/data/castle/princess peaches castle (outside).mtl +++ b/data/castle/princess peaches castle (outside).mtl @@ -147,7 +147,7 @@ Ks 0.000000 0.000000 0.000000 Ni 1.000000 d 1.000000 illum 2 -map_Kd 1FEE462_c.bmp +# map_Kd 1FEE462_c.bmp newmtl Material.095 diff --git a/data/castle/princess peaches castle (outside).obj b/data/castle/princess peaches castle (outside).obj index 86833e4..501742b 100644 --- a/data/castle/princess peaches castle (outside).obj +++ b/data/castle/princess peaches castle (outside).obj @@ -1935,6 +1935,7 @@ f 174/107 177/108 173/109 usemtl Material.095 f 175/107 177/108 174/109 f 176/107 173/108 177/109 +# Flag in back left usemtl Material.104 f 178/107 180/108 179/109 f 179/107 180/108 181/109 diff --git a/data/castle/princess peaches castle (outside)_grp.png b/data/castle/princess peaches castle (outside)_grp.png index af08566..5987f84 100644 Binary files a/data/castle/princess peaches castle (outside)_grp.png and b/data/castle/princess peaches castle (outside)_grp.png differ diff --git a/js/PointerCamera.js b/js/PointerCamera.js index 8a11cd2..3303f6c 100644 --- a/js/PointerCamera.js +++ b/js/PointerCamera.js @@ -49,8 +49,6 @@ var PointerCamera = function() { listenerTarget.addEventListener('mousemove', onMouseMove, false); listenerTarget.addEventListener('mouseup', onMouseUp, false); listenerTarget.addEventListener('mouseout', onMouseUp, false); - - console.log(arguments[3]); } PointerCamera.prototype = Object.create(THREE.PerspectiveCamera.prototype); PointerCamera.prototype.constructor = PointerCamera; diff --git a/prototype/js/main.js b/prototype/js/main.js index 78f7215..5727be8 100644 --- a/prototype/js/main.js +++ b/prototype/js/main.js @@ -24,6 +24,7 @@ function init() { renderer.setSize(container_size.width, container_size.height); renderer.shadowMapEnabled = true; renderer.setClearColor(0x87ceeb); + renderer.sortObjects = false // on initialise la scène scene = new THREE.Scene(); @@ -85,8 +86,13 @@ function init() { scene.add(object); object.traverse(function (object) { if (object instanceof THREE.Material){ + console.log(object.material.transparent) object.material.transparent = true; } + if (object instanceof THREE.Mesh) { + console.log(object.geometry.vertices.length); + object.geometry.mergeVertices(); + } }); }, onProgress, onError ); @@ -98,8 +104,12 @@ function init() { object.up = new THREE.Vector3(0,0,1); scene.add(object); object.traverse(function (object) { - if (object instanceof THREE.Material){ - object.material.transparent = true; + if (object instanceof THREE.Mesh) { + object.geometry.mergeVertices(); + if (object.material.name === 'Material.103_princess_peaches_cast') { + console.log(object.material.name); + object.material.transparent = true; + } } }); }, onProgress, onError );