Section A.4. Clip Planes


A.4. Clip Planes

Although OpenGL clips all geometry outside the view volume, you can clip geometry further with application-specified clip planes. Clip planes were introduced in OpenGL version 1.0. Modeling applications commonly use clip planes to render cutaway views of models.

To use clip planes:

  1. Enable the plane (for example, glEnable( GL_CLIP_PLANE0 )).

  2. Specify the plane with the four coefficients of the plane equation. For example:

     GLdouble peq[4] = { ... }; glClipPlane( GL_CLIP_PLANE0, peq ); 

The plane equation defines a half-space. While the plane equation is enabled, OpenGL renders geometry if it falls within the half-space and clips it otherwise.

For further information on clip planes, see Chapter 3, "Viewing," of OpenGL® Programming Guide and "glClipPlane" in OpenGL® Reference Manual.




OpenGL Distilled
OpenGL Distilled
ISBN: 0321336798
EAN: 2147483647
Year: 2007
Pages: 123
Authors: Paul Martz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net