Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!cornell!batcomputer!sun.soe.clarkson.edu!naughton From: naughton@sun.soe.clarkson.edu (Patrick Naughton) Newsgroups: comp.graphics Subject: triangles from polygons Message-ID: <726@sun.soe.clarkson.edu> Date: 13 Apr 88 17:14:35 GMT Sender: naughton@sun.soe.clarkson.edu Reply-To: naughton@sun.soe.clarkson.edu (Patrick Naughton) Organization: Clarkson University, Potsdam, NY Lines: 53 Problem: Given a polygon defined in three-space with three or more co-planar vertices create a list of triangles which don't overlap and yet cover the entire surface of the original n-agon. Fact: The number of triangles, t generated by an n-agon is [n-2;n>=3]. This may seem trivial... My first attempt was this: Given a polygon with vertices v[0]...v[n-1]: j = [2..n-1] a triangle is This will work iff the vertices are numbered in order reading clockwise or counterclockwise around the polygon. For example: Correct Incorrect v0----v1 v0----v1 |\ | |\ / | \ | | \/ | \ | | /\ | \ | |/ \ v3----v2 v2----v3 This problem obviously compounds when the number of vertices increases. I know that this has been done... SunCore handles it internally... If anyone can suggest a reference to this and other related problems such as how to resolve which polygon should be drawn first in a Z-buffer sort when the vertices overlap in the Z dimension... I'd be highly thankful... For the curious, I'm doing Gouraud/Phong shading under X11 and I've written the shading routines to deal with triangles and I now see that most 3d poly data is in n-agon format... sigh... -Patrick ___________________________________________ | | | Internet: naughton@sun.soe.clarkson.edu | | BITNET: naughton@CLUTX.BITNET | | uucp: {rpics, gould}!clutx!naughton | |___________________________________________| Soon to be naughton@sun.com (6/1/88)