Dima.Go
Dima.Go

Reputation: 472

How to cover a polygon with triangles

I'm using slimdx in c#, and my problem is a follows:
I have a list of vertices that forms a polygon, in linestrip format, and I need to transform it to a trianglestrip that covers the polygon.
I started with a center-of-mass calculation, however it only covers convex ones, and I need a general solution.
The final result should look smth like this:

Does anyone happens to know any algorithms for the issue?

Thanks.

Upvotes: 3

Views: 3099

Answers (1)

mrvux
mrvux

Reputation: 8963

There's ear clipping algorithm that is quite nice for your use case, an example can be found here:

Ear clipping c#

Upvotes: 2

Related Questions