RaananW Posted March 10, 2015 Share Posted March 10, 2015 Hi gang, After dad72 sent me a few meshes he has been trying to simplify, I noticed there was some kind of a problem with the simplification process.The meshes I have tested always worked, but external meshes were not simplified correctly - holes appeared where they shouldn't have had appear. Investigating that took a little while, and the result was that the meshes' indices are not optimized. meaning - Some vertices were duplicated during the export process, and were used as a reference of an index. this leads to no problem viewing the mesh, but presents a problem to the simplification process, since it relies heavily on the number of triangles using each vertex. Tl;dr Some of the exporters don't try to avoid redundant vertex data which is fine for viewing but not for simplification. If you encounter such a problem using the simplification function, you first need to optimize the indices. you do that by (surprisingly) using the optimizeIndices function now implemented in BABYLON.Mesh. It takes some time to optimize the indices (especially if it is a large mesh) so use it only when you really need it. Other than that I have accelerated the decimation process (removed a few unneeded lines of code and corrected some others). An example can be found here - http://www.babylonjs-playground.com/#2JBSNA#2 (be a bit patient, you will eventually see an alert dialog when it finishes). The skull simplifies quite nicely I will document everything in the next day or two. Any questions - please let me know. jerome, Wingnut and Dad72 3 Quote Link to comment Share on other sites More sharing options...
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.