来自搅拌机json的Three.js网格未显示

时间:2016-06-04 01:40:30

标签: json three.js blender

我正在使用three.js,我将一个混合转换为json,我想在three.js中使用。当我在不使用json中的材料的情况下显示它时(我只使用了BasicMaterial())它可以正常工作。当我尝试使用json中的材质时,它似乎没有呈现它。

这是我用来显示网格的代码:

var tower;
var loader = new THREE.JSONLoader();
loader.load( 'js/blends/towerlevel1-5.json', function ( geometry, material)   
{
        tower = new THREE.Mesh( geometry, material );
        scene.add( tower);
}); 

这是json材料:

"materials":[{
        "visible":true,
        "shading":"phong",
        "wireframe":false,
        "DbgIndex":0,
        "mapBumpRepeat":[1,1],
        "opacity":1,
        "mapDiffuse":"Wood.jpg",
        "mapBumpScale":[0.2,0.2],
        "mapBumpWrap":["RepeatWrapping","RepeatWrapping"],
        "colorEmissive":[0,0,0],
        "DbgName":"Wood2",
        "mapDiffuseAnisotropy":1,
        "mapDiffuseWrap":["RepeatWrapping","RepeatWrapping"],
        "DbgColor":15658734,
        "depthTest":true,
        "depthWrite":true,
        "specularCoef":50,
        "blending":"NormalBlending",
        "colorSpecular":[0.08,0.08,0.08],
        "mapDiffuseRepeat":[1,1],
        "transparent":false,
        "doubleSided":true,
        "mapBumpAnisotropy":1,
        "mapBump":"Wood.jpg",
        "colorDiffuse":[0.64,0.64,0.64]
    }],
    "vertices":[.....]
}

0 个答案:

没有答案