Re: How to get trinagles from a polygon?
From: ZMan (news-replies_at_thezbuffer)
Date: 07/09/04
- Next message: Ian Boyd: "Re: Best Practices for Timing?"
- Previous message: Michel Walsh: "Re: How to get trinagles from a polygon?"
- In reply to: Michel Walsh: "Re: How to get trinagles from a polygon?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 8 Jul 2004 17:21:34 -0700
For arbitrary triangles there are a lot of non trivial algorithms you can
find with google:
http://www.google.com/search?hl=en&ie=UTF-8&q=polygon+triangle+algorithm&spell=1
You might find the code already written in David Ebberleys archive
http://www.magic-software.com/Geometry.html - I don't have time to go
through the code. He has an algorothm in there for testing convexity
// Test for convexity: This function will iterate over the edges of the
// polygon and verify for each that the polygon vertices are all on the
// nonnegative side of the line. The threshold is the value that the
line
// distance d is compared to, d < 0. In theory the distances should all
// be nonegative. Floating point round-off errors can cause some small
// distances, so you might set fThreshold to a small negative number.
bool ValidateHalfSpaceProperty (Real fThreshold = (Real)0.0) const;
"Michel Walsh" <vanderghast@VirusAreFunnierThanSpam> wrote in message
news:%23uLznzSZEHA.712@TK2MSFTNGP11.phx.gbl...
> Hi,
>
>
> If the (in plane) polygon is concave, start at a vertex and read the
> other vertexes in succession (clock wise or anti-clock wise, dependant of
> the desired culling) as a fan-list of triangles. That's all.
>
> If it is convex, the previous process will generally fails (it may
> works
> on some special cases), but you may find it is preferable to get a way to
> divide the original convex polygon into 2 or more concave polygons, and
> then, to apply the previous process.
>
>
>
> Hoping it may help,
> Vanderghast, Access MVP
>
>
>
> "Dei" <daniel@leap.is.pcnet.ro> wrote in message
> news:e1G367PZEHA.1448@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> I have a polygon and I want to split it in triangles. I couldn't find any
>> function for this. I think there is such a function in OpenGL
>> "gluTessVertex" but I need one in DirectX.Managed.
>>
>> Thanks,
>> Daniel
>>
>>
>
>
- Next message: Ian Boyd: "Re: Best Practices for Timing?"
- Previous message: Michel Walsh: "Re: How to get trinagles from a polygon?"
- In reply to: Michel Walsh: "Re: How to get trinagles from a polygon?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|