使用obj2将OBJ转换为JSON后没有材质three.js
格式three.js(档案是three.js提供,,three.js-master\\utils\\converters\\obj2three.js).
执行obj2后three.js使用
ode,将创建jso
文件。
我使用ObjectLoader加载jso
文件,但无法显示材料,为什么?
我的js代码:nvar>nActual Result: It has no color , , ,nCan you please share the JSON file and the OBJ/MTL files in this thread?nBTW: Have you added any lights to your scene?n@ Mugen87nYes , I added lights.nbut when load Json file and obj/mtl files, I didn\"t modify the lights, and the display results are different.nJson file:serverbox.json 3 (905.5 KB)nObjectLoad Result:nObj/Mtl File:serverbox.mtl 2 (205 Bytes)nserverbox.obj 2 (350.0 KB)nTHREE.MTLLoader+THREE.OBJLoader Result:nWhy can\"t display the material with loading Json FilenOkay, the problem is that obj2three不支持MTL文件。因此,我建议以下解决方法:n- 将OBJ文件重命名为model.obj。n- 将MTL文件重命名为materials.mtl。n- 创建一个包含这两个文件的zip文件。n- 使用编辑器66加载存档文件(通过拖放“
”按钮)。n- 选择加载的对象,然后单击File -> Export Object。
No materials after converting OBJ to JSON with obj2three.jsn