NAMEglMap2d,glMap2f- define a two-dimensional evaluatorCSPECIFICATIONvoidglMap2d( GLenumtarget, GLdoubleu1, GLdoubleu2, GLintustride, GLintuorder, GLdoublev1, GLdoublev2, GLintvstride, GLintvorder, const GLdouble *points) voidglMap2f( GLenumtarget, GLfloatu1, GLfloatu2, GLintustride, GLintuorder, GLfloatv1, GLfloatv2, GLintvstride, GLintvorder, const GLfloat *points)PARAMETERStargetSpecifies the kind of values that are generated by the evaluator. Symbolic constantsGL_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, andGL_MAP2_TEXTURE_COORD_4are accepted.u1,u2Specify a linear mapping of u, as presented toglEvalCoord2, to^, one of the two variables that are evaluated by the equations specified by this command. Initially,u1is 0 andu2is 1.ustrideSpecifies the number of floats or doubles between the beginning of control point R and the beginning of control point R ij, where i and j are the u and v control pointiindices, 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 ofustrideis 0.uorderSpecifies the dimension of the control point array in the u axis. Must be positive. The initial value is 1.v1,v2Specify a linear mapping of v, as presented toglEvalCoord2, to^, one of the two variables that are evaluated by the equations specified by this command. Initially,v1is 0 andv2is 1.vstrideSpecifies the number of floats or doubles between the beginning of control point R and the beginning of control point R ij, 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 ofvstrideis 0.vorderSpecifies the dimension of the control point array in the v axis. Must be positive. The initial value is 1.pointsSpecifies a pointer to the array of control points.DESCRIPTIONEvaluators 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 usingglVertex,glNormal,glTexCoord, andglColorcommands, 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(^,^) as n m R R n m p(^,^) = i=0j=0Bi(^)Bj(^)Rij where R is a control point, Bn(^) is the ith Bernstein polynomial of degree i n (uorder= n+1) n (n ) i n-i Bi(^) = | |^(1-^) (i ) and Bm(^) is the jth Bernstein polynomial of degree m (vord<EM>er = m+1) m (m ) j m-j Bj(^) = | |^(1-^) (j ) Recall that 0 (n ) 0=1 and | |=1 ( 0 )glMap2is used to define the basis and to specify what kind of values are produced. Once defined, a map can be enabled and disabled by callingglEnableandglDisablewith the map name, one of the nine predefined values fortarget, described below. WhenglEvalCoord2presents values u and v, the bivariate Bernstein polynomials are evaluated using^and^, where^= _______u2 - u1^= _______v2 - v1targetis a symbolic constant that indicates what kind of control points are provided inpoints, and what output is generated when the map is evaluated. It can assume one of nine predefined values:GL_MAP2_VERTEX_3Each control point is three floating-point values representing x, y, and z. InternalglVertex3commands are generated when the map is evaluated.GL_MAP2_VERTEX_4Each control point is four floating-point values representing x, y, z, and w. InternalglVertex4commands are generated when the map is evaluated.GL_MAP2_INDEXEach control point is a single floating-point value representing a color index. InternalglIndexcommands are generated when the map is evaluated but the current index is not updated with the value of theseglIndexcommands.GL_MAP2_COLOR_4Each control point is four floating-point values representing red, green, blue, and alpha. InternalglColor4commands are generated when the map is evaluated but the current color is not updated with the value of theseglColor4commands.GL_MAP2_NORMALEach control point is three floating-point values representing the x, y, and z components of a normal vector. InternalglNormalcommands are generated when the map is evaluated but the current normal is not updated with the value of theseglNormalcommands.GL_MAP2_TEXTURE_COORD_1Each control point is a single floating-point value representing the s texture coordinate. InternalglTexCoord1commands are generated when the map is evaluated but the current texture coordinates are not updated with the value of theseglTexCoordcommands.GL_MAP2_TEXTURE_COORD_2Each control point is two floating-point values representing the s and t texture coordinates. InternalglTexCoord2commands are generated when the map is evaluated but the current texture coordinates are not updated with the value of theseglTexCoordcommands.GL_MAP2_TEXTURE_COORD_3Each control point is three floating-point values representing the s, t, and r texture coordinates. InternalglTexCoord3commands are generated when the map is evaluated but the current texture coordinates are not updated with the value of theseglTexCoordcommands.GL_MAP2_TEXTURE_COORD_4Each control point is four floating-point values representing the s, t, r, and q texture coordinates. InternalglTexCoord4commands are generated when the map is evaluated but the current texture coordinates are not updated with the value of theseglTexCoordcommands.ustride,uorder,vstride,vorder, andpointsdefine the array addressing for accessing the control points.pointsis 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 uorderxvorder control points in the array.ustridespecifies how many float or double locations are skipped to advance the internal memory pointer from control point R to control point R .vstridespecifies how many float or double locationsiarejskipped to advance the internal memory pointer from control point R to control point R . ij i(j+1)NOTESAs is the case with all GL commands that accept pointers to data, it is as if the contents ofpointswere copied byglMap2beforeglMap2returns. Changes to the contents ofpointshave no effect afterglMap2is called. Initially,GL_AUTO_NORMALis enabled. IfGL_AUTO_NORMALis enabled, normal vectors are generated when eitherGL_MAP2_VERTEX_3orGL_MAP2_VERTEX_4is used to generate vertices.ERRORSGL_INVALID_ENUMis generated iftargetis not an accepted value.GL_INVALID_VALUEis generated ifu1is equal tou2, or ifv1is equal tov2.GL_INVALID_VALUEis generated if eitherustrideorvstrideis less than the number of values in a control point.GL_INVALID_VALUEis generated if eitheruorderorvorderis less than 1 or greater than the return value ofGL_MAX_EVAL_ORDER.GL_INVALID_OPERATIONis generated ifglMap2is executed between the execution ofglBeginand the corresponding execution ofglEnd.ASSOCIATEDGETSglGetMapglGetwith argumentGL_MAX_EVAL_ORDERglIsEnabledwith argumentGL_MAP2_VERTEX_3glIsEnabledwith argumentGL_MAP2_VERTEX_4glIsEnabledwith argumentGL_MAP2_INDEXglIsEnabledwith argumentGL_MAP2_COLOR_4glIsEnabledwith argumentGL_MAP2_NORMALglIsEnabledwith argumentGL_MAP2_TEXTURE_COORD_1glIsEnabledwith argumentGL_MAP2_TEXTURE_COORD_2glIsEnabledwith argumentGL_MAP2_TEXTURE_COORD_3glIsEnabledwith argumentGL_MAP2_TEXTURE_COORD_4SEEALSOglBegin,glColor,glEnable,glEvalCoord,glEvalMesh,glEvalPoint,glMap1,glMapGrid,glNormal,glTexCoord,glVertex