c75 Posted December 28, 2015 Share Posted December 28, 2015 "CAP" procedure of extruding works not so goodHere is the demo of problemhttp://www.babylonjs-playground.com/#EALGM#0 Problem in Polygon triangulation algoritm. Will be nice if babylon include some effective triangulation algoritms.I think it can be good base https://github.com/mapbox/earcut for it. Unfortunately I'm weak to realize it myself Quote Link to comment Share on other sites More sharing options...
jerome Posted December 28, 2015 Share Posted December 28, 2015 yep The extrude cap process only computes the barycenter of the shape, so it can get some weird results if the shape isn't concave nor symetric what is the case in your demo.This a (my) choice of implementation because the extruded shapes can be dynamically morphed and the computation speed really matters to change the geometry on air. In brief, the cap algo must be as simple as possible.demo : http://www.babylonjs-playground.com/#20IBWW#2doc : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape So if you have a convex model shape and you don't need to morph your extrusion dynamically, I would suggest you not to use the embbeded caps but to generate a triangulated plane polygon instead : http://doc.babylonjs.com/classes/2.2/PolygonMeshBuilder Unless someone wants to try to implement a fast cap triangulation process RaananW and c75 2 Quote Link to comment Share on other sites More sharing options...
c75 Posted December 28, 2015 Author Share Posted December 28, 2015 Jerome, thank you. Now I understood why it realized so. And i did not know about "PolygonMeshBuilder" It works fine in my case.http://www.babylonjs-playground.com/#EALGM#1 Quote Link to comment Share on other sites More sharing options...
jerome Posted December 28, 2015 Share Posted December 28, 2015 happy it helped you 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.