简体   繁体   中英

Why the number of vertices of the exported obj model is three will become more

When I tried to export a plane obj model in blender, I found it in three JS, the number of vertices has increased,

obj model Blender Model

renderer After Renderer

The stray triangles make me think that, rather than additional vertices, what you're seeing is that one or more n-gons in your mesh (faces that have more than three sides) are being triangulated incorrectly somewhere in Blender's exporter or Three's importer.

OP 的渲染器屏幕截图,突出显示了其他三角形

Blender can handle n-gons (faces that have more than three sides), but a real-time renderer like Three.js thinks in triangles; if you try to give it n-gons instead of triangles, either the exporter or the importer will try to triangulate them by itself, with sometimes unfortunate results.

There are multiple ways to manually triangulate a mesh; here is just one.

In Blender, select your object and press Tab ⭾ to enter Edit Mode. Press 3 to enter Face Selection Mode, then A to select all faces, then F ( Vertex » New Edge/Face from Vertices ) to merge them into a single face. This may not be strictly necessary depending on particulars of your mesh that are unknown to me, but it gets us to a known state for the next step.

Now your mesh will have one face, and it will be selected. Press Ctrl T ( Face » Triangulate Faces ), and that single face will be split into several triangles, which will look something like the following.

显示三角剖分的搅拌机屏幕截图

The exact arrangement of the triangles may be different on your own model; what's important, though, is that all of the faces on the model are now triangles.

If you export the model from Blender and import it in Three.js now, it should appear as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM