Another thing: the results for a non-convex polygon are probably
device dependent. That is, you will get different things with
different OSs, different drivers or different graphics cards. What
you're seeing is OpenGL's "best guess" about how to triangulate the
polygon. The underlying renderer only deals with triangles, so
everything else is converted to triangles before being rendered. It's
best to convert things to triangles yourself to avoid unpredictable
results. This goes for quads too - while drawing squares using
GL_QUADS is easier than drawing squares using GL_TRIANGLES, non-
planar quads can produce bad results. Using triangles also avoids the
overhead (however small) of triangulating the polygon every frame.
Asher
-------------------------
Asher Dunn
Head Developer, Fireye Software
http://www.fireyesoftware.com/
AIM, Yahoo, MSN: crazedglkid
On Sep 27, 2006, at 3:01 PM, Asher Dunn wrote:
GL_LINE_LOOP draws a line between teach pair of vertices, pairing
the first with the last. GL_POLYGON draws a *convex* polygon
fitting the passed vertices. You cannot draw a non-convex or self-
intersecting polygon, and the results can be messy if you try (as
you have seen). I would suggest decomposing the shape into several
pieces - maybe a polygon for the center and a triangle for each tip.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|