NAME
glMap2d, glMap2f
- define a two-dimensional evaluator
C SPECIFICATION
void ggllMMaapp22dd(
GLenum _t_a_r_g_e_t,
GLdouble _u_1,
GLdouble _u_2,
GLint _u_s_t_r_i_d_e,
GLint _u_o_r_d_e_r,
GLdouble _v_1,
GLdouble _v_2,
GLint _v_s_t_r_i_d_e,
GLint _v_o_r_d_e_r,
const GLdouble _*_p_o_i_n_t_s )
void ggllMMaapp22ff(
GLenum _t_a_r_g_e_t,
GLfloat _u_1,
GLfloat _u_2,
GLint _u_s_t_r_i_d_e,
GLint _u_o_r_d_e_r,
GLfloat _v_1,
GLfloat _v_2,
GLint _v_s_t_r_i_d_e,
GLint _v_o_r_d_e_r,
const GLfloat _*_p_o_i_n_t_s )
delim $$
PARAMETERS
-
_t_a_r_g_e_t
-
Specifies the kind of values that are generated by the evaluator.
Symbolic constants
GGLL__MMAAPP22__VVEERRTTEEXX__33,
GGLL__MMAAPP22__VVEERRTTEEXX__44,
GGLL__MMAAPP22__IINNDDEEXX,
GGLL__MMAAPP22__CCOOLLOORR__44,
GGLL__MMAAPP22__NNOORRMMAALL,
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__11,
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__22,
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__33, and
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__44 are accepted.
-
_u_1, _u_2
-
Specify a linear mapping of $u$,
as presented to ggllEEvvaallCCoooorrdd22,
to $u hat$,
one of the two variables that are evaluated by the equations specified
by this command. Initially, _u_1 is 0 and _u_2 is 1.
-
_u_s_t_r_i_d_e
-
Specifies the number of floats or doubles between
the beginning of control point
$R sub ij$
and the beginning of control point
$R sub { (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 initial value of _u_s_t_r_i_d_e is 0.
-
_u_o_r_d_e_r
-
Specifies the dimension of the control point array in the $u$ axis.
Must be positive. The initial value is 1.
-
_v_1, _v_2
-
Specify a linear mapping of $v$,
as presented to ggllEEvvaallCCoooorrdd22,
to $v hat$,
one of the two variables that are evaluated by the equations specified
by this command. Initially, _v_1 is 0 and _v_2 is 1.
-
_v_s_t_r_i_d_e
-
Specifies the number of floats or doubles between
the beginning of control point
$R sub ij$
and the beginning of control point
$R sub { i (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 initial value of _v_s_t_r_i_d_e is 0.
-
_v_o_r_d_e_r
-
Specifies the dimension of the control point array in the $v$ axis.
Must be positive. The initial value is 1.
-
_p_o_i_n_t_s
-
Specifies a pointer to the array of control points.
DESCRIPTION
Evaluators provide a way to use polynomial or rational polynomial mapping
to produce vertices,
normals,
texture coordinates,
and colors.
The values produced by an evaluator are sent on to further stages
of GL processing just as if they had been presented using
ggllVVeerrtteexx,
ggllNNoorrmmaall,
ggllTTeexxCCoooorrdd, and
ggllCCoolloorr commands,
except that the generated 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 surfaces, and so on.
Evaluators define surfaces based on bivariate Bernstein polynomials.
Define $p ( u hat , v hat ) $ as
p ( u hat , v hat ) ~~=~~
down 30 {{size 18 {sum}} from {size 8 {i~=~0}} to {size 9 {n}} } ~
{{size 18 {sum}} from {size 8 {j~=~0}} to {size 9 {m}} } ~
up 15 { B sub i sup n ( u hat ) ~ B sub j sup m ( v hat ) ~ R sub ij }
where $R sub ij$ is a control point,
$B sub i sup n ( u hat )$
is the $i$th Bernstein polynomial of degree
$n$ (_u_o_r_d_e_r = $n ~+~ 1$)
B sub i sup n ( u hat ) ~~=~~ left ( down 20 {cpile { n above i }} ~ right
) u hat sup i ( 1 - u hat ) sup { n - i }
and $B sub j sup m ( v hat )$
is the $j$th Bernstein polynomial of degree $m$ (_v_o_r_d_e_r = $m ~+~ 1$)
B sub j sup m ( v hat ) ~~=~~ left ( ^down 20 {cpile { m above j }} ~^ right ) v hat sup j ( 1 - v hat ) sup { m - j }
Recall that
$0 sup 0 ~==~ 1 $ and $ left ( ^ down 20 {cpile { n above 0 }} ~^ right ) ~~==~~ 1 $
ggllMMaapp22 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 ggllEEnnaabbllee and ggllDDiissaabbllee
with the map name, one of the nine predefined values for _t_a_r_g_e_t,
described below.
When ggllEEvvaallCCoooorrdd22 presents values $u$ and $v$,
the bivariate Bernstein polynomials are evaluated using $u hat$ and $v hat$,
where
$u hat ~~=~~ {u ~-~ "u1"} over {"u2" ~-~ "u1"}$
$v hat ~~=~~ {v ~-~ "v1"} over {"v2" ~-~ "v1"}$
_t_a_r_g_e_t is a symbolic constant that indicates what kind of control points
are provided in _p_o_i_n_t_s,
and what output is generated when the map is evaluated.
It can assume one of nine predefined values:
-
GGLL__MMAAPP22__VVEERRTTEEXX__33
-
Each control point is three floating-point values representing
$x$, $y$, and $z$.
Internal ggllVVeerrtteexx33 commands are generated when the map is evaluated.
-
GGLL__MMAAPP22__VVEERRTTEEXX__44
-
Each control point is four floating-point values representing
$x$, $y$, $z$, and $w$.
Internal ggllVVeerrtteexx44 commands are generated when the map is evaluated.
-
GGLL__MMAAPP22__IINNDDEEXX
-
Each control point is a single floating-point value representing a color index.
Internal ggllIInnddeexx commands are generated when the map is evaluated
but the current index is not updated with the value of these
ggllIInnddeexx commands.
-
GGLL__MMAAPP22__CCOOLLOORR__44
-
Each control point is four floating-point values representing
red, green, blue, and alpha.
Internal ggllCCoolloorr44 commands are generated when the map is
evaluated but the current color is not updated with the value of
these ggllCCoolloorr44 commands.
-
GGLL__MMAAPP22__NNOORRMMAALL
-
Each control point is three floating-point values representing
the $x$, $y$, and $z$ components of a normal vector.
Internal ggllNNoorrmmaall commands are generated when the map is
evaluated but the current normal is not updated with the value of
these ggllNNoorrmmaall commands.
-
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__11
-
Each control point is a single floating-point value representing
the $s$ texture coordinate.
Internal
ggllTTeexxCCoooorrdd11 commands are generated when the map is evaluated but
the current texture coordinates are not updated with the value
of these ggllTTeexxCCoooorrdd commands.
-
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__22
-
Each control point is two floating-point values representing
the $s$ and $t$ texture coordinates.
Internal
ggllTTeexxCCoooorrdd22 commands are generated when the map is evaluated but
the current texture coordinates are not updated with the value
of these ggllTTeexxCCoooorrdd commands.
-
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__33
-
Each control point is three floating-point values representing
the $s$, $t$, and $r$ texture coordinates.
Internal ggllTTeexxCCoooorrdd33 commands are generated when the map is
evaluated but the current texture coordinates are not updated with the value
of these ggllTTeexxCCoooorrdd commands.
-
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__44
-
Each control point is four floating-point values representing
the $s$, $t$, $r$, and $q$ texture coordinates.
Internal
ggllTTeexxCCoooorrdd44 commands are generated when the map is evaluated but the current texture coordinates are not updated with the value
of these ggllTTeexxCCoooorrdd commands.
_u_s_t_r_i_d_e,
_u_o_r_d_e_r,
_v_s_t_r_i_d_e,
_v_o_r_d_e_r, and
_p_o_i_n_t_s define the array addressing for accessing the control points.
_p_o_i_n_t_s is the location of the first control point,
which occupies one, two, three, or four contiguous memory locations,
depending on which map is being defined.
There are $ "uorder" ~times~ "vorder" $ control points in the array.
_u_s_t_r_i_d_e specifies how many float or double locations are skipped to advance
the internal memory pointer from control point
$R sub {i j} $ to control point $R sub {(i+1) j} $.
_v_s_t_r_i_d_e specifies how many float or double locations are skipped to advance
the internal memory pointer from control point
$R sub {i j} $ to control point $R sub {i (j+1) } $.
NOTES
As is the case with all GL commands that accept pointers to data,
it is as if the contents of _p_o_i_n_t_s were copied by ggllMMaapp22 before ggllMMaapp22
returns.
Changes to the contents of _p_o_i_n_t_s have no effect after ggllMMaapp22 is called.
Initially, GGLL__AAUUTTOO__NNOORRMMAALL is enabled. If GGLL__AAUUTTOO__NNOORRMMAALL is enabled,
normal vectors are generated when either
GGLL__MMAAPP22__VVEERRTTEEXX__33 or GGLL__MMAAPP22__VVEERRTTEEXX__44 is used to generate
vertices.
ERRORS
GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _t_a_r_g_e_t is not an accepted value.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _u_1 is equal to _u_2,
or if _v_1 is equal to _v_2.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if either _u_s_t_r_i_d_e or _v_s_t_r_i_d_e
is less than the number of values in a control point.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if either _u_o_r_d_e_r or _v_o_r_d_e_r
is less than 1 or greater than the return value of GGLL__MMAAXX__EEVVAALL__OORRDDEERR.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllMMaapp22
is executed between the execution of
ggllBBeeggiinn
and the corresponding execution of ggllEEnndd.
When the GGLL__AARRBB__mmuullttiitteexxttuurree extension is supported,
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllMMaapp22 is called and the value
of GGLL__AACCTTIIVVEE__TTEEXXTTUURREE__AARRBB is not GGLL__TTEEXXTTUURREE00__AARRBB.
ASSOCIATED GETS
ggllGGeettMMaapp
ggllGGeett with argument GGLL__MMAAXX__EEVVAALL__OORRDDEERR
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__VVEERRTTEEXX__33
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__VVEERRTTEEXX__44
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__IINNDDEEXX
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__CCOOLLOORR__44
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__NNOORRMMAALL
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__11
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__22
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__33
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__44
SEE ALSO
ggllBBeeggiinn((33GG)),
ggllCCoolloorr((33GG)),
ggllEEnnaabbllee((33GG)),
ggllEEvvaallCCoooorrdd((33GG)),
ggllEEvvaallMMeesshh((33GG)),
ggllEEvvaallPPooiinntt((33GG)),
ggllMMaapp11((33GG)),
ggllMMaappGGrriidd((33GG)),
ggllNNoorrmmaall((33GG)),
ggllTTeexxCCoooorrdd((33GG)),
ggllVVeerrtteexx((33GG))