![]() |
|Download Files|
![]() ![]() ![]() ![]() ![]() Next: 2.12 Current Raster Position Up: 2 OpenGL Operation Previous: 2.10.4 Generating texture coordinates
2.11 ClippingPrimitives are clipped to the clip volume. In clip coordinates, the view volume is defined by This view volume may be further restricted by as many as n client-defined clip planes to generate the clip volume. (n is an implementation dependent maximum that must be at least 6.) Each client-defined plane specifies a half-space. The clip volume is the intersection of all such half-spaces with the view volume (if there no client-defined clip planes are enabled, the clip volume is the view volume). A client-defined clip plane is specified with
void ClipPlane ( enum p, double eqn[4] ) ;
The value of the first argument, p, is a symbolic constant,
CLIP_PLANEi, where i is an
integer between 0 and n-1,
indicating one of n client-defined clip planes.
eqn[4] is an array of four double-precision floating-point values.
These are the coefficients of a plane equation in object coordinates:
(where M is the current model-view matrix;
the resulting plane equation
is undefined if M is singular and may be inaccurate if
M is poorly-conditioned) to obtain the plane equation
coefficients in eye coordinates.
All points with eye coordinates lie in the half-space defined by the plane; points that do not satisfy this condition do not lie in the half-space.
Client-defined clip planes are enabled with the generic
Enable command and
disabled with the Disable command.
The value of the argument to either command is
CLIP_PLANEi where i is an integer
between 0 and n; specifying a value of i enables or disables the plane
equation with index i.
The constants obey
If the primitive under consideration is a point, then clipping passes it unchanged if it lies within the clip volume; otherwise, it is discarded. If the primitive is a line segment, then clipping does nothing to it if it lies entirely within the clip volume and discards it if it lies entirely outside the volume. If part of the line segment lies in the volume and part lies outside, then the line segment is clipped and new vertex coordinates are computed for one or both vertices. A clipped line segment endpoint lies on both the original line segment and the boundary of the clip volume.
This clipping produces a value,
The value of t is used in color and texture coordinate clipping (section 2.13.8). If the primitive is a polygon, then it is passed if every one of its edges lies entirely inside the clip volume and either clipped or discarded otherwise. Polygon clipping may cause polygon edges to be clipped, but because polygon connectivity must be maintained, these clipped edges are connected by new edges that lie along the clip volume's boundary. Thus, clipping may require the introduction of new vertices into a polygon. Edge flags are associated with these vertices so that edges introduced by clipping are flagged as boundary (edge flag TRUE), and so that original edges of the polygon that become cut off at these vertices retain their original flags. If it happens that a polygon intersects an edge of the clip volume's boundary, then the clipped polygon must include a point on this boundary edge. This point must lie in the intersection of the boundary edge and the convex hull of the vertices of the original polygon. We impose this requirement because the polygon may not be exactly planar.
A line segment or polygon whose vertices
have
Primitives rendered with clip planes must satisfy a complementarity
criterion.
Suppose a single clip plane with coefficients
Clipping requires at least 6 sets of plane equations (each consisting of four double-precision floating-point coefficients) and at least 6 corresponding bits indicating which of these client-defined plane equations are enabled. In the initial state, all client-defined plane equation coefficients are zero and all planes are disabled.
![]() ![]() ![]() ![]() ![]() Next: 2.12 Current Raster Position Up: 2 OpenGL Operation Previous: 2.10.4 Generating texture coordinates David Blythe Sat Mar 29 02:23:21 PST 1997
|