如何获取导出的json文件所具有的数据?例如,我有这个材料,我想改变mapDiffuse值,因为纹理。我怎么能在javascript函数中做到这一点?
"materials": [{
"transparent": false,
"DbgIndex": 0,
"mapDiffuseRepeat": [1,1],
"mapDiffuseAnisotropy": 1,
"specularCoef": 50,
"colorEmissive": [0,0,0],
"colorDiffuse": [0.64,0.64,0.64],
"wireframe": false,
"visible": true,
"blending": "NormalBlending",
"DbgColor": 15658734,
"mapDiffuse": "w.jpg",
"DbgName": "Material.005",
"opacity": 1,
"depthWrite": true,
"mapDiffuseWrap": ["RepeatWrapping","RepeatWrapping"],
"depthTest": true,
"shading": "phong",
"colorSpecular": [0.5,0.5,0.5],
"colorAmbient": [0.64,0.64,0.64]}, another 4 same materials (different names)
我不会退出this reference所以任何帮助都会受到赞赏。 谢谢!
答案 0 :(得分:1)
我找到了..
mesh.material.materials [4] .map = THREE.ImageUtils.loadTexture(“image.jpg”); mesh.material.materials [4] .needsUpdate = true;