Optimizing the triangulation

Started by
11 comments, last by Bakura 15 years, 8 months ago
Hi! I implemented the Cutting-Ear-Algorithm to triangulate any convex or concave polygon. The result is pretty good but sometimes there are some very thin triangles due to how the algorithm works. Is it recommended to optimize the triangulation or doesn't it really matters when rendering with DirectX or OpenGL? Which would be the best way to optimize the triangulation? Currently I try to compare the bounding circles of all adjoining triangles. If a triangule is completely in a bounding circle of another triangle I swap the segment between both triangles. This works pretty good but is much slower than the triangulation itself, and I'm still not sure if it's really worth it. Christian
Advertisement
Are you talking about optimising the algorithm, or optimising the resultant triangles for Direct3D/OpenGL?
I want to optimize the triangles by maximizing their internal angles, similiar to the Delaunay constraint.
This is the result so far, it creates a nice triangulation but it's still very slow at the moment. As you can see the long, thin triangles are replaced. I'm not sure if this is really appropriate.

Before optimization:


After optimization:


[Edited by - MrSparkle27 on July 28, 2008 2:20:53 PM]
Do you want to do this real-time? If not, there will of course be no harm in trying to reduce the amount of triangles while preserving the shape. But if you are doing it real-time, it will be hard to cut out a few extra triangles and render it faster than it will be to just render it all.
NetGore - Open source multiplayer RPG engine
Nope, I don't want to reduce the number of triangles. I just want to optimize the shape of the triangles.

The Cutting Ear algorithm can produce very thin triangles but I'm not sure if this could affect the output when rendering the mesh with DirectX or OpenGL.

In a 3d modelling program like 3ds max, it's always best to optimize the triangulation of the meshes to avoid ugly artefacts during rendering.

My question is wether it is recommended to optimize the triangulation or just waste of time.

Thanks,
Christian

PS: How can I include images to my postings?
Include images with good ol' <img src="" />.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
As long as you do flat-shading, it is probably no gain in optimizing it. But as soon as you do any pr. vertex normal stuff, I believe long narrow triangles will give you artifacts.
Yes, you may be right. I also thought about texture coordinates. I guess the interpolation of the uv coordinates along the long edges can result in really ugly distortion of the textures. Maybe it's really worth to implement a mesh optimizer though.
How did you optimize the triangles (as shown in your two photos) ? Which method are you using ?

This topic is closed to new replies.

Advertisement