OpenGL Distilled

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.

Категории