Hello
I have a two dimensional polygon mesh made of connected triangles represented like this:
- vertex array:
V = A, B, C, D, E, ...
- index array, triangle vertex indices in groups of 3 in counter-clockwise-order:
I = 0, 4, 3, ...
(so that e.g.V[0], V[4], V[3]
which isA-E-D
forms a triangle)
Example mesh
Now i want to traverse the boundary points in counter-clockwise-order, the starting vertex doesn't matter:
G, H, A, D, C, F
The reason for this is that i want to compute dynamic 2D shadows like in this article: http://www.gamedev.net/reference/programming/features/2dsoftshadow/page3.asp
Whats the best way to do this? I thought about computing a convex hull, but this seems too expensive because it's not using the triangle vertex indices, there has to be a better way.
Is there a way to make it work even for several polygons in one representation so that i get a list of boundary point lists for every connected polygon?
Thanks, abenthy