Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!uwm.edu!uwvax!clown.cs.wisc.edu!faber From: faber@clown.cs.wisc.edu (Ted Faber) Newsgroups: comp.graphics Subject: Re: clipping polygons to a viewport Summary: Paper reference Keywords: polygons,clipping Message-ID: <8660@spool.cs.wisc.edu> Date: 3 Oct 89 04:30:49 GMT References: <120@csinc.UUCP> Sender: news@spool.cs.wisc.edu Reply-To: faber@clown.cs.wisc.edu (Ted Faber) Organization: U of Wisconsin CS Dept Lines: 25 In article <120@csinc.UUCP> shal@csinc.UUCP (Shal Jain x848) writes: >Am looking for a very robust algorithm/code for clipping polygons to a >rectangular viewport. The polygons can be concave,convex or bow-tied. >The only reference I have is Newman-Sproull "Principals of Interactive >Computer Graphics". Any pointers,references etc. will be appreciated OK. I'll take a stab at this. No I'm not going to send code, but I do have a reference for you. Sutherland and Hodgman's "Reentrant Polygon Clipping" in Communications of the ACM, Vol 17, No. 1 Jan 1974 This is a good place to start, but I believe that their method will result in an unusual case for your case, namely that their algorithm will leave you with the two triangles in the viewport connected by two edges on the right edge of the VP. The two edges will be the same line. At the end of the paper they do go into detail about how to deal with this, as I recall, but it's been a while since I read it, so caveat emptor. The algorithm is an interesting approach and educational to implement. Good luck, Ted Faber No sig yet, but I can be reached at faber@cs.wisc.edu