JohnK Posted May 23, 2017 Share Posted May 23, 2017 Back in 2015 this PG produced a visible mesh http://www.babylonjs-playground.com/#1TGOMH#3 but does not in 2.5 or 3. Using the debug layer it seems to exist and has a boundingbox. Quote Link to comment Share on other sites More sharing options...
Gijs Posted May 24, 2017 Share Posted May 24, 2017 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.... JohnK 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.