1. 首页
  2. three.js

使用obj2将OBJ转换为JSON后没有材质three.js

我有一个.obj文件和mtl.file. 我用obj2将它们转换成json格式three.js(档案是three.js提供,,three.js-master\\utils\\converters\\obj2three.js).n执行obj2后three.js使用node,将创建json文件。n我使用ObjectLoader加载json文件,但无法显示材料,为什么?n我的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”按钮)。n- 选择加载的对象,然后单击File -> Export Object。n No materials after converting OBJ to JSON with obj2three.jsn

使用obj2将OBJ转换为JSON后没有材质three.js 为WP2原创文章,链接:https://www.wp2.cn/three-js/%e4%bd%bf%e7%94%a8obj2%e5%b0%86obj%e8%bd%ac%e6%8d%a2%e4%b8%bajson%e5%90%8e%e6%b2%a1%e6%9c%89%e6%9d%90%e8%b4%a8three-js/