next up previous contents
Next: 15.3.2 Refinements Up: 15.3 Gradual Cutaway Views Previous: 15.3 Gradual Cutaway Views   Contents

15.3.1 Steps to Generating a Cutaway Shell

  1. Draw the object internals with depth buffering.
  2. Enable and configure a 1 dimensional texture ramp; use GL_ ALPHA as the format.
  3. Enable and configure texture coordinate generation for the $s$ component; use eye linear, and set the $s$ eye plane to map $-z$ over the range of the object shell cutaway from $0$ to $1$.
  4. Enable blending, and set the blend mode: source is GL_ SRC_ALPHA, destination is GL_ ONE_MINUS_SRC_ALPHA.
  5. Render the shell of the object in depth order; most distant objects first. For convex shells, this could be done using face culling.
  6. Load a different texture ramp in the 1D texture map.
  7. Render the shell edges; you can do this by re-rendering the shell after call glPolygonMode() with the mode set to GL_ LINE.

If you want to render the shell edges, you'll need to use polygon offset, or some other method, such as using the stencil buffer, to avoid z fighting. A reasonable setting to try would be glPolygonOffset-1.f, -1.f(-1.f, -1.f).


next up previous contents
Next: 15.3.2 Refinements Up: 15.3 Gradual Cutaway Views Previous: 15.3 Gradual Cutaway Views   Contents
2001-01-10