2014-01-26 58 views
1

當我將collada從meshbasic轉換爲meshphong時,collada的某些部分消失了。這是爲什麼?當我將collada從meshbasic轉換爲meshphong時,collada的某些部分消失了。這是爲什麼?

var setMaterial = function(node) { 
            node.material = new THREE.MeshBasicMaterial({color: 0xff0000}); 
            console.log(node); 
            if (node.children) { 
            for (var i=0, thelength=node.children.length; i < thelength ; i++) { 
             setMaterial(node.children[i]); 
            } 
            } 
           } 
           setMaterial(dae); 

這工作,但後來這使得它的一半消失......

var setMaterial = function(node) { 
            node.material = new THREE.MeshBasicPhong({color: 0xff0000}); 
            console.log(node); 
            if (node.children) { 
            for (var i=0, thelength=node.children.length; i < thelength ; i++) { 
             setMaterial(node.children[i]); 
            } 
            } 
           } 
           setMaterial(dae); 

回答

1

我認爲有在名稱THREE.MeshBasicPhong無重大..... 改變它MeshPhongMaterial和試試..

node.material = new THREE.MeshPhongMaterial({color: 0xff0000}); 
+0

如果答案是有用的,請不要忘記接受答案。謝謝。 – user2089677