Opentk/Source/Bind/Specifications/Docs/glEvalCoord.xml
2009-03-08 00:46:58 +00:00

363 lines
18 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glEvalCoord">
<refmeta>
<refmetainfo>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>
</refmetainfo>
<refentrytitle>glEvalCoord</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glEvalCoord</refname>
<refpurpose>evaluate enabled one- and two-dimensional maps</refpurpose>
</refnamediv>
<!-- eqn: ignoring delim $$ -->
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord1f</function></funcdef>
<paramdef>GLfloat <parameter>u</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord1d</function></funcdef>
<paramdef>GLdouble <parameter>u</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord2f</function></funcdef>
<paramdef>GLfloat <parameter>u</parameter></paramdef>
<paramdef>GLfloat <parameter>v</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord2d</function></funcdef>
<paramdef>GLdouble <parameter>u</parameter></paramdef>
<paramdef>GLdouble <parameter>v</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>u</parameter></term>
<listitem>
<para>
Specifies a value that is the domain coordinate
<inlineequation><mml:math><mml:mi mathvariant="italic">u</mml:mi></mml:math></inlineequation>
to the basis function
defined in a previous <citerefentry><refentrytitle>glMap1</refentrytitle></citerefentry> or <citerefentry><refentrytitle>glMap2</refentrytitle></citerefentry> command.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>v</parameter></term>
<listitem>
<para>
Specifies a value that is the domain coordinate
<inlineequation><mml:math><mml:mi mathvariant="italic">v</mml:mi></mml:math></inlineequation>
to the basis function
defined in a previous <citerefentry><refentrytitle>glMap2</refentrytitle></citerefentry> command.
This argument is not present in a <function>glEvalCoord1</function> command.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord1fv</function></funcdef>
<paramdef>const GLfloat * <parameter>u</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord1dv</function></funcdef>
<paramdef>const GLdouble * <parameter>u</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord2fv</function></funcdef>
<paramdef>const GLfloat * <parameter>u</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEvalCoord2dv</function></funcdef>
<paramdef>const GLdouble * <parameter>u</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters2"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>u</parameter></term>
<listitem>
<para>
Specifies a pointer to an array containing
either one or two domain coordinates.
The first coordinate is
<inlineequation><mml:math><mml:mi mathvariant="italic">u</mml:mi></mml:math></inlineequation>.
The second coordinate is
<inlineequation><mml:math><mml:mi mathvariant="italic">v</mml:mi></mml:math></inlineequation>,
which is present only in <function>glEvalCoord2</function> versions.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glEvalCoord1</function> evaluates enabled one-dimensional maps at argument
<parameter>u</parameter>.
<function>glEvalCoord2</function> does the same for two-dimensional maps using
two domain values,
<parameter>u</parameter> and <parameter>v</parameter>.
To define a map, call <citerefentry><refentrytitle>glMap1</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glMap2</refentrytitle></citerefentry>; to enable and
disable it, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry>.
</para>
<para>
When one of the <function>glEvalCoord</function> commands is issued,
all currently enabled maps of the indicated dimension are evaluated.
Then,
for each enabled map,
it is as if the corresponding GL command had been issued with the
computed value.
That is,
if <constant>GL_MAP1_INDEX</constant> or
<constant>GL_MAP2_INDEX</constant> is enabled,
a <citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry> command is simulated.
If <constant>GL_MAP1_COLOR_4</constant> or
<constant>GL_MAP2_COLOR_4</constant> is enabled,
a <citerefentry><refentrytitle>glColor</refentrytitle></citerefentry> command is simulated.
If <constant>GL_MAP1_NORMAL</constant> or <constant>GL_MAP2_NORMAL</constant> is enabled,
a normal vector is produced,
and if any of
<constant>GL_MAP1_TEXTURE_COORD_1</constant>,
<constant>GL_MAP1_TEXTURE_COORD_2</constant>,
<constant>GL_MAP1_TEXTURE_COORD_3</constant>,
<constant>GL_MAP1_TEXTURE_COORD_4</constant>,
<constant>GL_MAP2_TEXTURE_COORD_1</constant>,
<constant>GL_MAP2_TEXTURE_COORD_2</constant>,
<constant>GL_MAP2_TEXTURE_COORD_3</constant>, or
<constant>GL_MAP2_TEXTURE_COORD_4</constant> is enabled, then an appropriate <citerefentry><refentrytitle>glTexCoord</refentrytitle></citerefentry> command is simulated.
</para>
<para>
For color,
color index,
normal,
and texture coordinates the GL uses evaluated values instead of current values for those evaluations
that are enabled,
and current values otherwise,
However,
the evaluated values do not update the current values.
Thus, if <citerefentry><refentrytitle>glVertex</refentrytitle></citerefentry> commands are interspersed with <function>glEvalCoord</function>
commands, the color,
normal,
and texture coordinates associated with the <citerefentry><refentrytitle>glVertex</refentrytitle></citerefentry> commands are not
affected by the values generated by the <function>glEvalCoord</function> commands,
but only by the most recent
<citerefentry><refentrytitle>glColor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glNormal</refentrytitle></citerefentry>, and
<citerefentry><refentrytitle>glTexCoord</refentrytitle></citerefentry> commands.
</para>
<para>
No commands are issued for maps that are not enabled.
If more than one texture evaluation is enabled for a particular dimension
(for example, <constant>GL_MAP2_TEXTURE_COORD_1</constant> and
<constant>GL_MAP2_TEXTURE_COORD_2</constant>),
then only the evaluation of the map that produces the larger
number of coordinates
(in this case, <constant>GL_MAP2_TEXTURE_COORD_2</constant>)
is carried out.
<constant>GL_MAP1_VERTEX_4</constant> overrides <constant>GL_MAP1_VERTEX_3</constant>,
and
<constant>GL_MAP2_VERTEX_4</constant> overrides <constant>GL_MAP2_VERTEX_3</constant>,
in the same manner.
If neither a three- nor a four-component vertex map is enabled for the
specified dimension,
the <function>glEvalCoord</function> command is ignored.
</para>
<para>
If you have enabled automatic normal generation,
by calling <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> with argument <constant>GL_AUTO_NORMAL</constant>,
<function>glEvalCoord2</function> generates surface normals analytically,
regardless of the contents or enabling of the <constant>GL_MAP2_NORMAL</constant> map.
Let
</para>
<para>
<informalequation><mml:math>
<!-- eqn: bold m = { {partial bold p} over {partial u} } times { {partial bold p} over {partial v} }:-->
<mml:mrow>
<mml:mi mathvariant="bold">m</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mfenced open="" close="">
<mml:mfrac>
<mml:mfenced open="" close="">
<mml:mrow>
<mml:mo>&PartialD;</mml:mo>
<mml:mi mathvariant="bold">p</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="" close="">
<mml:mrow>
<mml:mo>&PartialD;</mml:mo>
<mml:mi mathvariant="italic">u</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mfrac>
</mml:mfenced>
<mml:mo>&times;</mml:mo>
<mml:mfenced open="" close="">
<mml:mfrac>
<mml:mfenced open="" close="">
<mml:mrow>
<mml:mo>&PartialD;</mml:mo>
<mml:mi mathvariant="bold">p</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="" close="">
<mml:mrow>
<mml:mo>&PartialD;</mml:mo>
<mml:mi mathvariant="italic">v</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
</para>
<para>
Then the generated normal
<inlineequation><mml:math>
<!-- eqn: bold n:-->
<mml:mi mathvariant="bold">n</mml:mi>
</mml:math></inlineequation>
is
<inlineequation><mml:math>
<!-- eqn: bold n = bold m over { || bold m || }:-->
<mml:mrow>
<mml:mi mathvariant="bold">n</mml:mi>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mi mathvariant="bold">m</mml:mi>
<mml:mfenced open="" close="">
<mml:mfenced open="&DoubleVerticalBar;" close="&DoubleVerticalBar;">
<mml:mi mathvariant="bold">m</mml:mi>
</mml:mfenced>
</mml:mfenced>
</mml:mfrac>
</mml:mrow>
</mml:math></inlineequation>
</para>
<para>
If automatic normal generation is disabled,
the corresponding normal map <constant>GL_MAP2_NORMAL</constant>,
if enabled,
is used to produce a normal.
If neither automatic normal generation nor a normal map is enabled,
no normal is generated for
<function>glEvalCoord2</function> commands.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_VERTEX_3</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_VERTEX_4</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_INDEX</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_COLOR_4</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_NORMAL</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_TEXTURE_COORD_1</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_TEXTURE_COORD_2</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_TEXTURE_COORD_3</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP1_TEXTURE_COORD_4</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_VERTEX_3</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_VERTEX_4</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_INDEX</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_COLOR_4</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_NORMAL</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_TEXTURE_COORD_1</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_TEXTURE_COORD_2</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_TEXTURE_COORD_3</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_MAP2_TEXTURE_COORD_4</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_AUTO_NORMAL</constant>
</para>
<para>
<citerefentry><refentrytitle>glGetMap</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEvalMesh</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEvalPoint</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMap1</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMap2</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMapGrid</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glNormal</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexCoord</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertex</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>