我想學習three.js,所以我的下一個個人chalenge是從攪拌機導入模型,一切都很順利,但一些紋理呈現一些問題(使用演示鏈接能夠看見了)。Three.js JSONLoader紋理問題
這裏有一個演示託管在這裏:https://googledrive.com/host/0BynsKHbZoT73elJpaUxqTlprVjQ/demos/3dworld/
在JS控制檯,您可以檢查的材料,您還可以檢查game.models.tree
從攪拌機中導出的材料:
materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "Material",
"blending" : "NormalBlending",
"colorAmbient" : [0.699999988079071, 0.699999988079071, 0.699999988079071],
"colorDiffuse" : [0.699999988079071, 0.699999988079071, 0.699999988079071],
"colorSpecular" : [0.125, 0.10904927551746368, 0.08209432661533356],
"depthTest" : true,
"depthWrite" : true,
"mapLight" : "Tree_Bark_Tiled.png",
"mapLightWrap" : ["repeat", "repeat"],
"mapNormal" : "Tree_Bark_Nor2.png",
"mapNormalFactor" : -1.0,
"mapNormalWrap" : ["repeat", "repeat"],
"shading" : "Phong",
"specularCoef" : 15,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "Material.001",
"blending" : "NormalBlending",
"colorAmbient" : [1.0, 1.0, 1.0],
"colorDiffuse" : [1.0, 1.0, 1.0],
"colorSpecular" : [0.0, 0.0, 0.0],
"depthTest" : true,
"depthWrite" : true,
"mapLight" : "Tree_Leaves.png",
"mapLightWrap" : ["repeat", "repeat"],
"mapNormal" : "Tree_Leaves_Nor.png",
"mapNormalFactor" : -1.0,
"mapNormalWrap" : ["repeat", "repeat"],
"shading" : "Phong",
"specularCoef" : 15,
"transparency" : 1.0,
"transparent" : true,
"vertexColors" : false
},
{
"DbgColor" : 60928,
"DbgIndex" : 2,
"DbgName" : "Material.001",
"blending" : "NormalBlending",
"colorAmbient" : [1.0, 1.0, 1.0],
"colorDiffuse" : [1.0, 1.0, 1.0],
"colorSpecular" : [0.0, 0.0, 0.0],
"depthTest" : true,
"depthWrite" : true,
"mapLight" : "Tree_Leaves.png",
"mapLightWrap" : ["repeat", "repeat"],
"mapNormal" : "Tree_Leaves_Nor.png",
"mapNormalFactor" : -1.0,
"mapNormalWrap" : ["repeat", "repeat"],
"shading" : "Phong",
"specularCoef" : 15,
"transparency" : 1.0,
"transparent" : true,
"vertexColors" : false
},
{
"DbgColor" : 238,
"DbgIndex" : 3,
"DbgName" : "Material",
"blending" : "NormalBlending",
"colorAmbient" : [0.699999988079071, 0.699999988079071, 0.699999988079071],
"colorDiffuse" : [0.699999988079071, 0.699999988079071, 0.699999988079071],
"colorSpecular" : [0.125, 0.10904927551746368, 0.08209432661533356],
"depthTest" : true,
"depthWrite" : true,
"mapLight" : "Tree_Bark_Tiled.png",
"mapLightWrap" : ["repeat", "repeat"],
"mapNormal" : "Tree_Bark_Nor2.png",
"mapNormalFactor" : -1.0,
"mapNormalWrap" : ["repeat", "repeat"],
"shading" : "Phong",
"specularCoef" : 15,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
這是三個在攪拌機的外觀:
正如你所看到的,透明度消失了,樹皮紋理也沒有正確映射。
有人可以請解釋我做錯了什麼?
謝謝:)
感謝您的評論我會盡快嘗試它,只要我到家。我期待看到一棵樹很好:) –
在家試過了,現在我有一棵很漂亮的樹,非常感謝你的建議:) –