home *** CD-ROM | disk | FTP | other *** search
-
- Simple capping demonstration
-
- This program renders capped and intersected objects. It uses stencil
- and user-defined clipping planes to compute and light the internal
- surfaces (where they are exposed by a clipping plane) and to highlight
- intersections of solids. All in Just 1200 lines of code!
-
-
-
- When a polygonal surface representation of a solid object is
- clipped, the inside of the "solid" is revealed. This
- program demonstrates a technique to "cap" the solid, so that
- it appears solid even when clipped. In order to do this, it
- draws each object twice, once to render the visible surfaces,
- and again counting the number of accesses at each pixel.
- Finally, the clipping planes themselves are drawn, with pixels
- actually modified only where the pixel access count in the
- stencil buffer is odd (i.e. where the inside of a solid was
- revealed).
-
-
- type "make demo" to run the program
-