Jump to content

PolygonMeshBuilder.build() No Longer Works Solved. Not a bug.


JohnK
 Share

Recommended Posts

Maybe it never quite worked. This playground does produce a visible mesh on Edge, but it also produces error messages in the log, just like other browsers. I tried using code from older versions, but the problem persisted, so maybe the browsers behaved differently back then. Apparently PolygonMeshBuilder uses Earcut to fill the space between vertices with triangles, but it is misleadingly named "path" in your playground. It works if you don't add the first vertex again (the reference image):

http://www.babylonjs-playground.com/#1TGOMH#8

#3 would also work if you add a small offset to either the first or the last vertex, so them having (virtually) the same position seems to be the problem. When I added random vertices twice, it also corrupted the mesh sometimes. You can see with polygon.getIndices() that corrupted meshes have some missing indices, but I don't know why that would only sometimes make the mesh invalid.... :huh:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...