- define a two-dimensional evaluator
C SPECIFICATION
PARAMETERS
_param1 Specifies the kind of values that are generated
by the evaluator. Symbolic constants
GL_MAP2_VERTEX_3, GL_MAP2_VERTEX_4,
GL_MAP2_INDEX, GL_MAP2_COLOR_4, GL_MAP2_NORMAL,
GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2,
GL_MAP2_TEXTURE_COORD_3, and
GL_MAP2_TEXTURE_COORD_4 are accepted.
_param2, _param3
Specify a linear mapping of u, as presented to
glEvalCoord2, to <I>u, one of the two variables that
are evaluated by the equations specified by this
command. Initially, _param2 is 0 and _param3 is
1.
_param4 Specifies the number of floats or doubles between
the beginning of control point Rij and the begin-
ning of control point R(i+1)j, where i and j are
the u and v control point indices, respectively.
This allows control points to be embedded in
arbitrary data structures. The only constraint
is that the values for a particular control point
must occupy contiguous memory locations. The ini-
tial value of _param4 is 0.
_param5 Specifies the dimension of the control point
array in the u axis. Must be positive. The ini-
tial value is 1.
_param6, _param7
Specify a linear mapping of v, as presented to
glEvalCoord2, to <I>v, one of the two variables that
are evaluated by the equations specified by this
command. Initially, _param6 is 0 and _param7 is
1.
_param8 Specifies the number of floats or doubles between
the beginning of control point Rij and the begin-
ning of control point Ri(j+1), where i and j are
the u and v control point indices, respectively.
This allows control points to be embedded in
arbitrary data structures. The only constraint
is that the values for a particular control point
must occupy contiguous memory locations. The ini-
tial value of _param8 is 0.
_param9 Specifies the dimension of the control point
ated values do not update the current normal, texture
coordinates, or color.
All polynomial or rational polynomial splines of any
degree (up to the maximum degree supported by the GL
implementation) can be described using evaluators. These
include almost all surfaces used in computer graphics,
including B-spline surfaces, NURBS surfaces, Bezier sur-
faces, and so on.
Evaluators define surfaces based on bivariate Bernstein
polynomials. Define p(<I>u,<I>v) as
n_ m_
p(<I>u,<I>v)= > > Bn<I>i(<I>u)Bm<I>j(<I>v)Rij
i=0j=0
where Rij is a control point, Bn<I>i(<I>u) is the ith Bernstein
polynomial of degree
n (_param5 = n+1)
n
Bn<I>i(<I>u)=( )<I>ui(1-<I>u)n-i
i
and Bm<I>j(<I>v) is the jth Bernstein polynomial of degree m
(_param9 = m+1)
Bm<I>j(<I>v)=( )<I>vj(1-<I>v)m-j
j
Recall that n
00==1 and ( )==1
0
glMap2 is used to define the basis and to specify what
kind of values are produced. Once defined, a map can be
enabled and disabled by calling glEnable and glDisable
with the map name, one of the nine predefined values for
_param1, described below. When glEvalCoord2 presents val-
ues u and v, the bivariate Bernstein polynomials are eval-
uated using <I>u and <I>v, where
<I>u=_e_q_n_p_u<I>a_<I>r_<I>a_e<I>m_q_n_p_a<I>e_r<I>q_a<I>n_m<I>p_<I>a_r_a_m__
<I>v=_e_q_n_p_v<I>a_<I>r_<I>a_e<I>m_q_n_p_a<I>e_r<I>q_a<I>n_m<I>p_<I>a_r_a_m__
_param1 is a symbolic constant that indicates what kind of
control points are provided in _param10, and what output
is generated when the map is evaluated. It can assume one
of nine predefined values:
floating-point value representing
a color index. Internal glIndex
commands are generated when the
map is evaluated but the current
index is not updated with the
value of these glIndex commands.
GL_MAP2_COLOR_4 Each control point is four float-
ing-point values representing
red, green, blue, and alpha.
Internal glColor4 commands are
generated when the map is evalu-
ated but the current color is not
updated with the value of these
glColor4 commands.
GL_MAP2_NORMAL Each control point is three
floating-point values represent-
ing the x, y, and z components of
a normal vector. Internal
glNormal commands are generated
when the map is evaluated but the
current normal is not updated
with the value of these glNormal
commands.
GL_MAP2_TEXTURE_COORD_1 Each control point is a single
floating-point value representing
the s texture coordinate. Inter-
nal
glTexCoord1 commands are gener-
ated when the map is evaluated
but the current texture coordi-
nates are not updated with the
value of these glTexCoord com-
mands.
GL_MAP2_TEXTURE_COORD_2 Each control point is two float-
ing-point values representing the
s and t texture coordinates.
Internal
glTexCoord2 commands are gener-
ated when the map is evaluated
but the current texture coordi-
nates are not updated with the
value of these glTexCoord com-
mands.
GL_MAP2_TEXTURE_COORD_3 Each control point is three
floating-point values represent-
ing the s, t, and r texture coor-
dinates. Internal glTexCoord3
value of these glTexCoord com-
mands.
_param4, _param5, _param8, _param9, and _param10 define
the array addressing for accessing the control points.
_param10 is the location of the first control point, which
occupies one, two, three, or four contiguous memory loca-
tions, depending on which map is being defined. There are
_eqnparam5x_eqnparam9 control points in the array.
_param4 specifies how many float or double locations are
skipped to advance the internal memory pointer from con-
trol point Rij to control point R(i+1)j. _param8 speci-
fies how many float or double locations are skipped to
advance the internal memory pointer from control point Rij
to control point Ri(j+1).
NOTES
As is the case with all GL commands that accept pointers
to data, it is as if the contents of _param10 were copied
by glMap2 before glMap2 returns. Changes to the contents
of _param10 have no effect after glMap2 is called.
Initially, GL_AUTO_NORMAL is enabled. If GL_AUTO_NORMAL is
enabled, normal vectors are generated when either
GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 is used to generate
vertices.
ERRORS
GL_INVALID_ENUM is generated if _param1 is not an accepted
value.
GL_INVALID_VALUE is generated if _param2 is equal to
_param3, or if _param6 is equal to _param7.
GL_INVALID_VALUE is generated if either _param4 or _param8
is less than the number of values in a control point.
GL_INVALID_VALUE is generated if either _param5 or _param9
is less than 1 or greater than the return value of
GL_MAX_EVAL_ORDER.
GL_INVALID_OPERATION is generated if glMap2 is executed
between the execution of glBegin and the corresponding
execution of glEnd.
When the GL_ARB_multitexture extension is supported,
GL_INVALID_OPERATION is generated if glMap2 is called and
the value of GL_ACTIVE_TEXTURE_ARB is not GL_TEXTURE0_ARB.
ASSOCIATED GETS
glGetMap
glGet with argument GL_MAX_EVAL_ORDER
1