home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / graphics / 12933 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  2.3 KB

  1. Path: sparky!uunet!vnet.ibm.com
  2. From: capelli@vnet.ibm.com (Ron Capelli)
  3. Message-ID: <19921215.155422.690@almaden.ibm.com>
  4. Date: Tue, 15 Dec 92 17:49:24 EST
  5. Newsgroups: comp.graphics
  6. Subject: Re: Clipping polygon to rectangle
  7. Disclaimer: This posting represents the poster's views, not those of IBM
  8. News-Software: UReply 3.0
  9. References: <724442088.9285@minster.york.ac.uk>
  10. Lines: 39
  11.  
  12. In <724442088.9285@minster.york.ac.uk> john@minster.york.ac.uk writes:
  13. >I have read the subsections of ``Computer graphics: principles
  14. >and practice'' [Foley90], which describe algorithms for clipping a
  15. >polygon to a rectangle. None of the algorithms there meet my desire
  16. >for correctness with simplicity and practicality. (I do not require
  17. >completeness, as I am prepared to accept the output of a single degenerate
  18. >polygon instead of a list of disjoint polygons.) I've not found
  19. >anything better in older graphics textbooks, or in a brief literature
  20. >search. (Ok, so I'm crying for the moon - but someone out there
  21. >probably has a method of reaching it. :-))
  22. >
  23. >The Sutherland-Hodgman algorithm (described in [Foley90] and older
  24. >graphics texts I have read) clips against each side of the
  25. >rectangle in turn, and produces three intermediate polygons - which
  26. >I assume require a (single, extra) temporary buffer to hold them.
  27. >This I do not like.
  28.  
  29. No intermediate polygons need be saved between stages of a
  30. Sutherland-Hodgman polygon clipper.
  31.  
  32. The clipped edges output for each side of the clipping region
  33. (eg., rectangle) are in the order they need to be considered
  34. for the next side.  Therefore, the stages can be cascaded in a
  35. recursive-like way.  The output of each stage except the last
  36. can be implemented as a call to the subsequent stage, and the
  37. last stage outputs the edges of the clipped polygon, possibly
  38. with degenerate edges along the sides of the clipping region.
  39.  
  40. The title of the original paper by Sutherland and Hodgman,
  41. "Reentrant Polygon Clipping", CACM, vol 17, no 1, Jan 1974,
  42. refers to this cascading of clipping stages.
  43. _______________________________________________________________________
  44.  
  45. ...Ron Capelli                 IBM Corp.  Dept. C13,  Bldg. 703-2
  46.    capelli@vnet.ibm.com        PO Box 950
  47.    (914) 435-1673              Poughkeepsie, NY  12602
  48. _______________________________________________________________________
  49.  
  50. "There are no answers, only cross-references."
  51.