GLMAP1(3G)
β¨ GLMAP1(3G) β¨
okay bestie, welcome to glMap1d / glMap1f from the 3G manual β the one-dimensional evaluator era, and yes it's giving β¨math class but make it graphicsβ¨ π¦
π NAME π
glMap1d, glMap1f β define a one-dimensional evaluator. periodt. π
πΈ C SPECIFICATION πΈ
void glMap1d( GLenum target,
GLdouble u1,
GLdouble u2,
GLint stride,
GLint order,
const GLdouble *points )
void glMap1f( GLenum target,
GLfloat u1,
GLfloat u2,
GLint stride,
GLint order,
const GLfloat *points )
two flavors, same energy: the d one is double, the f one is float. pick your fighter π₯
π PARAMETERS π
targetβ tells the evaluator what kind of values it's gonna spit out. the accepted symbolic constants areGL_MAP1_VERTEX_3,GL_MAP1_VERTEX_4,GL_MAP1_INDEX,GL_MAP1_COLOR_4,GL_MAP1_NORMAL,GL_MAP1_TEXTURE_COORD_1,GL_MAP1_TEXTURE_COORD_2,GL_MAP1_TEXTURE_COORD_3, andGL_MAP1_TEXTURE_COORD_4. nine options, all iconic πu1,u2β these set up a linear mapping ofu(the one you hand toglEvalCoord1) ontouβ the variable that actually gets evaluated by the equations this command defines. yes it'sumapped tou, that's just how it is bestie πstrideβ how many floats or doubles sit between the beginning of one control point and the beginning of the next inside the data structure thatpointspoints at. this is so control points can be embedded in whatever chaotic data structure you want. the one and only constraint: the values for a single control point have to live in contiguous memory locations. no skipping around inside one point, that's the rule π«orderβ the number of control points. must be positive. that's the whole vibe check.pointsβ a pointer to the array of control points. that's it, that's the whole thing π«Ά
β¨ DESCRIPTION β¨
Evaluators are a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. the values an evaluator produces get sent off to the further stages of GL processing exactly as if you'd handed them over yourself using glVertex, glNormal, glTexCoord, and glColor β with one big caveat: the generated values do not update the current normal, texture coordinates, or color. they're like, backstage passes, not the main stage. π€
Every polynomial or rational polynomial spline of any degree (up to the maximum degree your GL implementation supports) can be described with evaluators. that includes pretty much every spline in computer graphics: B-splines, Bezier curves, Hermite splines, and so on. the range, honestly. π
Evaluators define curves based on Bernstein polynomials. define p(u) as
p(u)=iΞ£0Bi(u)Ri
where Ri is a control point and Bi(u) is the ith Bernstein polynomial of degree n (where order = n+1):
Bi(u)=βnβ ui(1βu)nβi
i
and recall that
00β‘1 and βnβ β‘1
0
glMap1 is what you use to define the basis and to specify what kind of values get produced. once it's defined, a map can be enabled and disabled by calling glEnable and glDisable with the map name β which is one of the nine predefined values for target described down below. glEvalCoord1 is the one that evaluates the one-dimensional maps that are enabled. when glEvalCoord1 presents a value u, the Bernstein functions get evaluated using u, where
u=_____
target is a symbolic constant that says what kind of control points you're providing in points, and what output gets generated when the map is evaluated. it can be one of nine predefined values:
π¦ the nine targets π¦
GL_MAP1_VERTEX_3β each control point is three floating-point values representingx,y, andz. internalglVertex3commands get generated when the map is evaluated. πGL_MAP1_VERTEX_4β each control point is four floating-point values representingx,y,z, andw. internalglVertex4commands get generated when the map is evaluated.GL_MAP1_INDEXβ each control point is a single floating-point value representing a color index. internalglIndexcommands get generated when the map is evaluated, but the current index is not updated with the value of thoseglIndexcommands. noted. πGL_MAP1_COLOR_4β each control point is four floating-point values representing red, green, blue, and alpha. internalglColor4commands get generated when the map is evaluated, but the current color is not updated with the value of thoseglColor4commands.GL_MAP1_NORMALβ each control point is three floating-point values representing thex,y, andzcomponents of a normal vector. internalglNormalcommands get generated when the map is evaluated, but the current normal is not updated with the value of thoseglNormalcommands.GL_MAP1_TEXTURE_COORD_1β each control point is a single floating-point value representing thestexture coordinate. internalglTexCoord1commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of thoseglTexCoordcommands.GL_MAP1_TEXTURE_COORD_2β each control point is two floating-point values representing thesandttexture coordinates. internalglTexCoord2commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of thoseglTexCoordcommands.GL_MAP1_TEXTURE_COORD_3β each control point is three floating-point values representing thes,t, andrtexture coordinates. internalglTexCoord3commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of thoseglTexCoordcommands.GL_MAP1_TEXTURE_COORD_4β each control point is four floating-point values representing thes,t,r, andqtexture coordinates. internalglTexCoord4commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of thoseglTexCoordcommands.
π§ the addressing trio π§
stride, order, and points are the ones that define the array addressing for accessing the control points.
points is the location of the first control point, which occupies one, two, three, or four contiguous memory locations β depends on which map you're defining.
order is the number of control points in the array.
stride says how many float or double locations to advance that internal memory pointer to reach the next control point. literally just "how far do i walk to find your friend" energy πΆβοΈ
β NOTES β
same deal as every GL command that accepts pointers to data: it's as if the contents of points were copied by glMap1 before glMap1 returns. so changing what's inside points afterwards? no effect. none. zero. the copy is already made, bestie. π
π ERRORS π
these are the "you did what now" moments. read them, respect them.
GL_INVALID_ENUMis generated iftargetis not an accepted value.GL_INVALID_VALUEis generated ifu1is equal tou2.GL_INVALID_VALUEis generated ifstrideis less than the number of values in a control point.GL_INVALID_VALUEis generated iforderis less than 1 or greater than the return value ofGL_MAX_EVAL_ORDER.GL_INVALID_OPERATIONis generated ifglMap1is executed between the execution ofglBeginand the corresponding execution ofglEnd. don't do that. π«- when the
GL_ARB_multitextureextension is supported,GL_INVALID_OPERATIONis generated ifglMap1is called and the value ofGL_ACTIVE_TEXTURE_ARBis notGL_TEXTURE0_ARB.
π ASSOCIATED GETS π
glGetMapglGetwith argumentGL_MAX_EVAL_ORDERglIsEnabledwith argumentGL_MAP1_VERTEX_3glIsEnabledwith argumentGL_MAP1_VERTEX_4glIsEnabledwith argumentGL_MAP1_INDEXglIsEnabledwith argumentGL_MAP1_COLOR_4glIsEnabledwith argumentGL_MAP1_NORMALglIsEnabledwith argumentGL_MAP1_TEXTURE_COORD_1glIsEnabledwith argumentGL_MAP1_TEXTURE_COORD_2glIsEnabledwith argumentGL_MAP1_TEXTURE_COORD_3glIsEnabledwith argumentGL_MAP1_TEXTURE_COORD_4
π SEE ALSO π
glBegin(3G), glColor(3G), glEnable(3G), glEvalCoord(3G), glEvalMesh(3G), glEvalPoint(3G), glMap2(3G), glMapGrid(3G), glNormal(3G), glTexCoord(3G), glVertex(3G)
okay that's the whole page bestie, you ate it π
β¨ that was GLMAP1(3G) β this girl is signing off from the GLMAP1(3G) manual page, no version, no date, just pure 3G energy. stay polynomial π«ΆπΈπ
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- fedora 43: gl-manpages 1.1-34.20190306.fc43 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- fedora 44: gl-manpages 1.1-35.20190306.fc44 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms