home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!hal.com!olivea!sgigate!odin!fido!bedlam.asd.sgi.com!davis
- From: davis@bedlam.asd.sgi.com (Tom Davis)
- Newsgroups: comp.sys.sgi
- Subject: Re: Hidden line removal...
- Message-ID: <1e0l5jINNdr7@fido.asd.sgi.com>
- Date: 13 Nov 92 16:29:39 GMT
- References: <BxnnxK.CCK@cs.dal.ca>
- Organization: Silicon Graphics, Inc.
- Lines: 24
- NNTP-Posting-Host: bedlam.asd.sgi.com
-
- Hidden line removal is pretty easy with stencil planes.
-
- The basic idea is to draw each polygon first as its
- outline in the wire-frame color, and then draw the
- interior (filled) polygon in the background color. This
- will clobber any lines behind it (assuming you're using
- Z buffering, of course).
-
- The problem is that the polygon interior may also
- clobber some of the outline and your picture will look
- pretty raspy.
-
- To get it right, for each polygon, clear the stencil
- plane, draw the outline in both the stencil plane and
- in the framebuffer, then draw the polygon's interior
- at only those points where the stencil plane is still
- clear. Thus the outline can't be clobbered by the
- interior.
-
- This will be pretty slow if you clear the stencil
- planes after each polygon, but note that they can be
- cleared after the first time by simply drawing the
- outline again, and erasing the stencil plane whereever
- the outline occurs.
-