
<refentry id="glClipPlane">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>glClipPlane</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glClipPlane</refname>
        <refpurpose>specify a plane against which all geometry is clipped</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glClipPlane</function></funcdef>
                <paramdef>GLenum <parameter>plane</parameter></paramdef>
                <paramdef>const GLdouble * <parameter>equation</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <!-- eqn: ignoring delim $$ -->
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>plane</parameter></term>
            <listitem>
                <para>
                    Specifies which clipping plane is being positioned.
                    Symbolic names of the form <constant>GL_CLIP_PLANE</constant><emphasis>i</emphasis>,
                    where <emphasis>i</emphasis> is an integer between 0 and <constant>GL_MAX_CLIP_PLANES</constant>
                    <inlineequation><mml:math>
                        <!-- eqn: - 1:-->
                        <mml:mn>-1</mml:mn>
                    </mml:math></inlineequation>,
                    are accepted.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><parameter>equation</parameter></term>
            <listitem>
                <para>
                    Specifies the address of an array of four double-precision floating-point values.
                    These values are interpreted as a plane equation.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            Geometry is always clipped against the boundaries of a six-plane frustum
            in <emphasis>x</emphasis>, <emphasis>y</emphasis>, and <emphasis>z</emphasis>.
            <function>glClipPlane</function> allows the specification of additional planes,
            not necessarily perpendicular to the <emphasis>x</emphasis>, <emphasis>y</emphasis>, or <emphasis>z</emphasis> axis,
            against which all geometry is clipped.
            To determine the maximum number of additional clipping planes, call
            <citerefentry><refentrytitle>glGetIntegerv</refentrytitle></citerefentry> with argument <constant>GL_MAX_CLIP_PLANES</constant>. All
            implementations support at least six such clipping planes.
            Because the resulting clipping region is the intersection
            of the defined half-spaces,
            it is always convex.
        </para>
        <para>
            <function>glClipPlane</function> specifies a half-space using a four-component plane equation.
            When <function>glClipPlane</function> is called,
            <parameter>equation</parameter> 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 <emphasis>in</emphasis> with respect to that clipping plane.
            Otherwise, it is <emphasis>out</emphasis>.
        </para>
        <para>
            To enable and disable clipping planes, call
            <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with the argument
            <constant>GL_CLIP_PLANE</constant><emphasis>i</emphasis>,
            where <emphasis>i</emphasis> is the plane number.
        </para>
        <para>
            All clipping planes are initially defined as (0, 0, 0, 0) in eye coordinates
            and are
            disabled.
        </para>
    </refsect1>
    <refsect1 id="notes"><title>Notes</title>
        <para>
            It is always the case that <constant>GL_CLIP_PLANE</constant>
            <inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>
            = <constant>GL_CLIP_PLANE0</constant> + 
            <inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>.
        </para>
    </refsect1>
    <refsect1 id="errors"><title>Errors</title>
        <para>
            <constant>GL_INVALID_ENUM</constant> is generated if <parameter>plane</parameter> is not an accepted value.
        </para>
        <para>
            <constant>GL_INVALID_OPERATION</constant> is generated if <function>glClipPlane</function>
            is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
            and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
        </para>
    </refsect1>
    <refsect1 id="associatedgets"><title>Associated Gets</title>
        <para>
            <citerefentry><refentrytitle>glGetClipPlane</refentrytitle></citerefentry>
        </para>
        <para>
            <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_CLIP_PLANE</constant><emphasis>i</emphasis>
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"></trademark> 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
        </para>
    </refsect1>
</refentry>
