【发布时间】:2016-02-27 14:52:33
【问题描述】:
如何获取导出的 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,因此我们将不胜感激。 谢谢!
【问题讨论】:
标签: javascript json three.js textures