GLMAP1(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

✨ 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 are GL_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, and GL_MAP1_TEXTURE_COORD_4. nine options, all iconic πŸ‘‘
  • u1, u2 β€” these set up a linear mapping of u (the one you hand to glEvalCoord1) onto u β€” the variable that actually gets evaluated by the equations this command defines. yes it's u mapped to u, 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 that points points 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 representing x, y, and z. internal glVertex3 commands get generated when the map is evaluated. πŸ‘‘
  • GL_MAP1_VERTEX_4 β€” each control point is four floating-point values representing x, y, z, and w. internal glVertex4 commands get generated when the map is evaluated.
  • GL_MAP1_INDEX β€” each control point is a single floating-point value representing a color index. internal glIndex commands get generated when the map is evaluated, but the current index is not updated with the value of those glIndex commands. noted. πŸ“
  • GL_MAP1_COLOR_4 β€” each control point is four floating-point values representing red, green, blue, and alpha. internal glColor4 commands get generated when the map is evaluated, but the current color is not updated with the value of those glColor4 commands.
  • GL_MAP1_NORMAL β€” each control point is three floating-point values representing the x, y, and z components of a normal vector. internal glNormal commands get generated when the map is evaluated, but the current normal is not updated with the value of those glNormal commands.
  • GL_MAP1_TEXTURE_COORD_1 β€” each control point is a single floating-point value representing the s texture coordinate. internal glTexCoord1 commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of those glTexCoord commands.
  • GL_MAP1_TEXTURE_COORD_2 β€” each control point is two floating-point values representing the s and t texture coordinates. internal glTexCoord2 commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of those glTexCoord commands.
  • GL_MAP1_TEXTURE_COORD_3 β€” each control point is three floating-point values representing the s, t, and r texture coordinates. internal glTexCoord3 commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of those glTexCoord commands.
  • GL_MAP1_TEXTURE_COORD_4 β€” each control point is four floating-point values representing the s, t, r, and q texture coordinates. internal glTexCoord4 commands get generated when the map is evaluated, but the current texture coordinates are not updated with the value of those glTexCoord commands.

🧚 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_ENUM is generated if target is not an accepted value.
  • GL_INVALID_VALUE is generated if u1 is equal to u2.
  • GL_INVALID_VALUE is generated if stride is less than the number of values in a control point.
  • GL_INVALID_VALUE is generated if order is less than 1 or greater than the return value of GL_MAX_EVAL_ORDER.
  • GL_INVALID_OPERATION is generated if glMap1 is executed between the execution of glBegin and the corresponding execution of glEnd. don't do that. 🚫
  • when the GL_ARB_multitexture extension is supported, GL_INVALID_OPERATION is generated if glMap1 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
  • glIsEnabled with argument GL_MAP1_VERTEX_3
  • glIsEnabled with argument GL_MAP1_VERTEX_4
  • glIsEnabled with argument GL_MAP1_INDEX
  • glIsEnabled with argument GL_MAP1_COLOR_4
  • glIsEnabled with argument GL_MAP1_NORMAL
  • glIsEnabled with argument GL_MAP1_TEXTURE_COORD_1
  • glIsEnabled with argument GL_MAP1_TEXTURE_COORD_2
  • glIsEnabled with argument GL_MAP1_TEXTURE_COORD_3
  • glIsEnabled with argument GL_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