3D Mesh simplification lazarus / 39-Graphics ---------------------------------------------------------------------- ChrisR · 2016-05-30 20:47 I recently ported a very fast mesh simplification algorithm to FPC/Lazarus/Delphi. This can reduce the level of detail in a triangulated mesh, allowing games to require less disk space and render more interactively. In particular, it can be used after one uses marching cubes to convert a 3D voxelwise volume into a triangulated mesh (see my open source Surf Ice software for an example of how to conduct marching cubes in Pascal). I would be happy for feedback from anyone who wants to try this out. The demo program will load a mesh saved in the popular Lightwave OBJ, decimate it the desired amount, and save the reduced mesh back to OBJ format:   https://github.com/neurolabusc/Fast-Quadric-Mesh-Simplification- Pascal- Since this algorithm is so quick, it can be used interactively to see the results. ---------------------------------------------------------------------- lainz · 2016-05-30 23:46 Hi, you've tried decimate from Blender? https://wiki.blender.org/index.php/Doc:2.4/Manual/Modifiers/Generate/D ecimate How it compares to your application? I did some tests and here are my results: 1) original dragon.obj > 213504 tris 1.1) simplify dragon.obj out.obj 0.2 > 106752 tris, 106752 faces, 53378 verts 1.2) blender decimate ratio 0.5 > 106752 tris, 71180 faces, 53378 verts yes, both codes can generate same tris object with different settings. your code is somewhat faster, but in blender I can live preview. At the left yours output, at the right blender decimate: http://postimg.org/image/5uq2hcibf/full/ ---------------------------------------------------------------------- ChrisR · 2016-05-31 13:20 Blender is a terrific program, but not something that Lazarus, Delphi or FPC users can directly integrate into their projects. I would point out that you can live view the performance with Sven's algorithm using my Surf Ice software   https://www.nitrc.org/plugins/mwiki/index.php/surfice:MainPage#Advan ced_Notes which is open source, written in Lazarus, compiles to OSX/Windows/Linux using Intel/AMD/NVidia graphics cards. The demo project I created does not live view because I wanted to create a minimal sample project that developers can plug into their own Lazarus, FPC or Delphi projects. It is also included in my Surf Ice code, but that is a much more complicated project and would not elegantly illustrate the code in a way that could be bolted on to other projects. ---------------------------------------------------------------------- lainz · 2016-06-01 00:21 Thanks for this is really usefull. ---------------------------------------------------------------------- ChrisR · 2016-06-06 14:59 lainz, I have also added this mesh simplification to my simple modern OpenGL demo, allowing live viewing for the process:   https://github.com/neurolabusc/plyview This is a minimal project to view OBJ/PLY files, decimate meshes, and save to OBJ format. It is a bit more complicated than my command line project, but does allow mesh viewing and is no where near as complicated as my Surf Ice project. ---------------------------------------------------------------------- lainz · 2016-06-06 15:26 Nice, I'll try it.