问题描述
在我的3D对象中;我有几个盒子;
In my 3D object; I have several boxes like;
但是,如果我尝试加载并显示 obj 和 mtl 文件,其中包含不能正确加载Three.js,5面或5面以上对象的文件(如下所示).然后;我发现three.js仅支持3面或4面.
But if I try to load and display obj and mtl file with three.js, 5-sided or more-sided objects not loaded properly ( like below ) . Then; I discover that three.js supports only 3-sided or 4-sided faces.
有什么解决方案可以将这些面分割为目标文件并将其加载?
Is there any solution to divide these faces in object file and load them ?
推荐答案
导出模型之前,需要对模型进行三角剖分.那里的大多数3D编辑器都具有此选项.一些编辑器在OBJ导出器选项中将该选项作为选项.如果不是这样,您可以复制/备份模型,进行三角剖分,导出然后删除/隐藏.
You need to triangulate your model before exporting it. Most 3D editors out there have this option. Some editors have that as option in the OBJ exporter options. If that's not an option you can make a copy/backup of the model, triangulate that, export then delete/hide.
这篇关于解析wavefront obj文件由three.js中的多边形组成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!