/ comp / gb.opengl / gl / clipplane
Gl.ClipPlane (gb.opengl)
Syntax

    STATIC SUB ClipPlane ( Plane AS Integer, Equation AS Float[] )

### Specify a plane against which all geometry is clipped

#### Parameters

- Plane specifies which clipping plane is being positioned. Symbolic names of the form Gl.GL_CLIP_PLANEi, where i is an integer between 0 and Gl.MaxClipPlanes -1, are accepted.

- Equation specifies an array of four Float values. These values are interpreted as a plane equation.

#### Description

Geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z. Gl.ClipPlane allows the specification of additional planes, not necessarily perpendicular to the x, y, or z axis, against which all geometry is clipped. Up to Gl.MaxClipPlanes planes can be specified, where Gl.MaxClipLanes is at least six in all implementations. Because the resulting clipping region is the intersection of the defined half-spaces, it is always convex.

Gl.ClipPlane specifies a half-space using a four-component plane equation. When Gl.ClipPlane is called, equation is transformed by the inverse of the modelview matrix and stored in the resulting eye coordinates. Subsequent changes to the modelview matrix have no effect on the stored plane-equation components. If the dot product of the eye coordinates of a vertex with the stored plane equation components is positive or zero, the vertex is in with respect to that clipping plane. Otherwise, it is out.

Clipping planes are enabled and disabled with Gl.Enable and Gl.Disable, and called with the argument Gl.GL_CLIP_PLANEi, where i is the plane number. By default, all clipping planes are defined as (0, 0, 0, 0) in eye coordinates and are disabled.

| It is always the case that Gl.GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i.

#### Errors

Gl.GL_INVALID_ENUM is generated if plane is not an accepted value.
Gl.GL_INVALID_OPERATION is generated if Gl.ClipPlane is called between a call to Gl.Begin and the corresponding call to Gl.End.

#### Associated Gets

Gl.GetClipPlane
Gl.IsEnabled with argument Gl.GL_CLIP_PLANEi

### See also

Gl.Enable