简体   繁体   中英

How can can I simplify a basic mesh without losing any shape at all?

Now I know mesh simplification has been something people have been studying for years, but I dont really need the sort of simplification you may be thinking. I have been working on a game which makes heavy uses of procedural meshes. One of the algorithms im using has a flaw, a big flaw, It creates a ton of artifact triangles in the mesh. For example if I had a flat square plane, and performed this algorithm on it, it would still be a flat square plane, but thousands to millions of useless triangles got added. So my question is how can I simplify a mesh by collapsing useless triangles, I dont care to reduce overall polygon count, simply to remove triangles that are all on flat surfaces and are 100% useless. Heres a example picture of the problem, its a flat side of a cube. This picture should pretty clearly describe the problem. Im using Unity and c#.

I have done a ton of research and I keep hearing about Edge Collapse but I cant find anything specifically on this case. Is Edge collapse the correct method to use? and if so how could I go about implementing it in a situation like this? All existing methods use it to do your usual mesh simplification.

Update: Heres a short clip showing the Before and After mesh's

I would not suggest edge collapse here. What I would do is :

  1. Compute the normal of each triangle and do a classification in several clusters (lists of triangles) that share same plane (=same normal and same distance to origin) .
  2. For each cluster, make a classification in subclusters of triangles that are connected (or overlapping, because it seems that your image has overlaps)
  3. For each subcluster, compute the boundary. Or the convex hull if you have overlapping triangles. Optative step : check for 3 or more consecutive vertex in the boundary that are aligned, and remove intermediate vertex.
  4. Triangulate the boundary. This is trivial for convex hull, and easy for non-convex boundary.
  5. Exchange all triangles in the subcluster with the triangles of step 4.

The trivial convex hull triangulation consist in choosing an edge and create triangles with that edge and every else vertex in the hull.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM