Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!brunix!jfh From: jfh@brunix (John Forbes Hughes) Newsgroups: comp.graphics Subject: Re: Vector Clipping Message-ID: <13260@brunix.UUCP> Date: 22 Aug 89 14:10:40 GMT References: <4670@tekig5.PEN.TEK.COM> <378@maytag.waterloo.edu> Sender: news@brunix.UUCP Reply-To: jfh@euclid.UUCP (John Forbes Hughes) Distribution: na Organization: Brown University Department of Computer Science Lines: 31 In article <378@maytag.waterloo.edu> lhf@Self.UUCP (Luiz H. deFigueiredo) writes: >In article <4670@tekig5.PEN.TEK.COM> peteru@tekig5.PEN.TEK.COM (Peter Uchytil) writes: >>Hi, I need an algorithm that will do vector clipping. Ideally it would >>work like this: give it the clipping window and the endpoints of the >>vector and it gives you the new endpoints back. There must be an >>algorithm of this type somewhere out there. Can someone point me in the >>right direction? Thanks! > >How about one of the text books like > Newman & Sproll, Foley & van Dan, Baker, Harrison, etc... >They all explain the Choen-Sutherland algorithm for vector clipping. The new edition of Foley and van Dam (now 'Foley, van Dam, Feiner, and Hughes') contains not only Cohen-Sutherland, but also the Cyrus-Beck/Liang- Barsky algorithms, which are more efficient, in that the average number of intersections computed is smaller than that for C-S. We also describe the Nicholl-Lee-Nicholl algorithm, which is the most efficient, but involves a great deal of code, because of its case-by-case analysis. If you are truly fascinated by these, let me know and I can fax you the relevant pages of the text (or send you the words, but not the pictures, via e-mail). One interesting question: only C-S does 3D clipping. How hard is it to generalize NLN-clipping to 3D? -John Hughes, Mathematics and Computer Science Dept's., Brown University CSnet: jfh@cs.brown.edu@relay.cs.net ARPAnet: jfh@CS.BROWN.EDU BITNET: jfh@browncs UUCP: ...!{decvax,allegra}!brunix!jfh "I was in this prematurely air-conditioned supermarket and there were all these aisles..." -L. Childs