NAME

glMap1d, glMap1f - define a one-dimensional evaluator

C SPECIFICATION

void ggllMMaapp11dd( GLenum _t_a_r_g_e_t,
              GLdouble _u_1,
              GLdouble _u_2,
              GLint _s_t_r_i_d_e,
              GLint _o_r_d_e_r,
              const GLdouble _*_p_o_i_n_t_s )
void ggllMMaapp11ff( GLenum _t_a_r_g_e_t,
              GLfloat _u_1,
              GLfloat _u_2,
              GLint _s_t_r_i_d_e,
              GLint _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__MMAAPP11__VVEERRTTEEXX__33, GGLL__MMAAPP11__VVEERRTTEEXX__44, GGLL__MMAAPP11__IINNDDEEXX, GGLL__MMAAPP11__CCOOLLOORR__44, GGLL__MMAAPP11__NNOORRMMAALL, GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__11, GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__22, GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__33, and GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__44 are accepted.
_u_1, _u_2
Specify a linear mapping of $u$, as presented to ggllEEvvaallCCoooorrdd11, to $u hat$, the variable that is evaluated by the equations specified by this command.
_s_t_r_i_d_e
Specifies the number of floats or doubles between the beginning of one control point and the beginning of the next one in the data structure referenced in _p_o_i_n_t_s. 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.
_o_r_d_e_r
Specifies the number of control points. Must be positive.
_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 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 splines used in computer graphics: B-splines, Bezier curves, Hermite splines, and so on.

Evaluators define curves based on Bernstein polynomials. Define $p ( u hat ^) $ as

$p ( u hat ^) ~~=~~ up 10 { sum from i=0 to n } B sub i sup n ( u hat ^) R sub i$

where $R sub i$ is a control point and $B sub i sup n ( u hat ^)$ is the $i$th Bernstein polynomial of degree $n$ (_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 }$

Recall that

$0 sup 0 ~==~ 1 $ and $ left ( down 20 {cpile { n above ~0 }} ~~ right ) ~~==~~ 1 $

ggllMMaapp11 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. ggllEEvvaallCCoooorrdd11 evaluates the one-dimensional maps that are enabled. When
ggllEEvvaallCCoooorrdd11 presents a value $u$, the Bernstein functions are evaluated using $u hat$, where

$u hat ~~=~~ {u ~-~ "u1"} over {"u2" ~-~ "u1"}$


_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__MMAAPP11__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__MMAAPP11__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__MMAAPP11__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__MMAAPP11__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__MMAAPP11__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__MMAAPP11__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__MMAAPP11__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__MMAAPP11__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__MMAAPP11__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.

_s_t_r_i_d_e, _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. _o_r_d_e_r is the number of control points in the array. _s_t_r_i_d_e specifies how many float or double locations to advance the internal memory pointer to reach the next control point.

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 ggllMMaapp11 before ggllMMaapp11 returns. Changes to the contents of _p_o_i_n_t_s have no effect after ggllMMaapp11 is called.

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.

GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _s_t_r_i_d_e is less than the number of values in a control point.

GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _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 ggllMMaapp11 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 ggllMMaapp11 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__MMAAPP11__VVEERRTTEEXX__33
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__VVEERRTTEEXX__44
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__IINNDDEEXX
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__CCOOLLOORR__44
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__NNOORRMMAALL
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__11
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__22
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__33
ggllIIssEEnnaabblleedd with argument GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__44

SEE ALSO

ggllBBeeggiinn((33GG)), ggllCCoolloorr((33GG)), ggllEEnnaabbllee((33GG)), ggllEEvvaallCCoooorrdd((33GG)), ggllEEvvaallMMeesshh((33GG)), ggllEEvvaallPPooiinntt((33GG)), ggllMMaapp22((33GG)), ggllMMaappGGrriidd((33GG)), ggllNNoorrmmaall((33GG)), ggllTTeexxCCoooorrdd((33GG)), ggllVVeerrtteexx((33GG))