From ebee998282b7299b3cbf0e055a83221736404102 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 15 Apr 2015 17:01:17 +0200 Subject: [PATCH] Transparent carpet --- .../princess peaches castle (outside).obj | 32 +++++++++---------- prototype/js/main.js | 10 +++--- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/data/castle/princess peaches castle (outside).obj b/data/castle/princess peaches castle (outside).obj index 501742b..3caf768 100644 --- a/data/castle/princess peaches castle (outside).obj +++ b/data/castle/princess peaches castle (outside).obj @@ -2341,22 +2341,22 @@ f 460/561 377/560 461/563 f 462/564 336/565 463/562 f 336/565 462/564 337/566 usemtl Material.104 -f 735/107 468/108 470/109 -f 594/107 593/108 464/109 -f 593/107 595/108 464/109 -f 465/107 735/108 466/109 -f 733/107 735/108 465/109 -f 470/107 468/108 467/109 -f 468/107 734/108 467/109 -f 476/107 469/108 738/109 -f 466/107 735/108 470/109 -f 472/107 471/108 473/109 -f 738/107 472/108 473/109 -f 475/107 474/108 737/109 -f 736/107 475/108 737/109 -f 737/107 476/108 738/109 -f 589/107 587/108 477/109 -f 587/107 591/108 477/109 +# f 735/107 468/108 470/109 +# f 594/107 593/108 464/109 +# f 593/107 595/108 464/109 +# f 465/107 735/108 466/109 +# f 733/107 735/108 465/109 +# f 470/107 468/108 467/109 +# f 468/107 734/108 467/109 +# f 476/107 469/108 738/109 +# f 466/107 735/108 470/109 +# f 472/107 471/108 473/109 +# f 738/107 472/108 473/109 +# f 475/107 474/108 737/109 +# f 736/107 475/108 737/109 +# f 737/107 476/108 738/109 +# f 589/107 587/108 477/109 +# f 587/107 591/108 477/109 usemtl Material.104_princess_peaches_cast f 478/567 480/568 479/569 f 480/568 740/570 479/569 diff --git a/prototype/js/main.js b/prototype/js/main.js index d54870a..b2669f3 100644 --- a/prototype/js/main.js +++ b/prototype/js/main.js @@ -76,6 +76,7 @@ function init() { object.traverse(function (object) { if (object instanceof THREE.Mesh) { object.geometry.mergeVertices(); + object.material.side = THREE.DoubleSide; if (object.material.name === 'Material.103_princess_peaches_cast') { console.log(object.material.name); object.material.transparent = true; @@ -97,13 +98,14 @@ function init() { object.up = new THREE.Vector3(0,0,1); 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) { + object.material.side = THREE.DoubleSide; console.log(object.geometry.vertices.length); object.geometry.mergeVertices(); + if (object.material.name === 'Material.054_777F0E0B_c.bmp' || + object.material.name === 'Material.061_5C3492AB_c.bmp' ) { + object.material.transparent = true; + } } }); }, onProgress, onError );