GLMAPGRID(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸ’… GLMAPGRID β€” bestie, it's the mesh-defining era ✨

okay so this is glMapGrid from the 3G manual, and she's literally the one who draws the little grid lines your eval mesh struts along. four whole functions, one iconic job. let's get into it πŸŽ€


🌈 NAME 🌈

glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f β€” they define a one- or two-dimensional mesh. that's it. that's the whole vibe. πŸ‘‘


✨ C SPECIFICATION ✨

no cap, here's exactly what you call:

void glMapGrid1d( GLint un,
                  GLdouble u1,
                  GLdouble u2 )
void glMapGrid1f( GLint un,
                  GLfloat u1,
                  GLfloat u2 )
void glMapGrid2d( GLint un,
                  GLdouble u1,
                  GLdouble u2,
                  GLint vn,
                  GLdouble v1,
                  GLdouble v2 )
void glMapGrid2f( GLint un,
                  GLfloat u1,
                  GLfloat u2,
                  GLint vn,
                  GLfloat v1,
                  GLfloat v2 )

notice the d and f versions, bestie β€” one takes GLdouble, one takes GLfloat. pick your precision, live your truth πŸ’–


πŸ¦‹ PARAMETERS πŸ¦‹

  • un β€” how many partitions you want in the grid range interval [u1, u2]. must be positive, okay? zero and negatives are NOT it.
  • u1, u2 β€” these specify the mappings for the integer grid domain values i=0 and i=un.
  • vn β€” how many partitions you want in the grid range interval [v1, v2]. (glMapGrid2 only, bestie β€” the 1D girlies don't have a v.)
  • v1, v2 β€” these specify the mappings for the integer grid domain values j=0 and j=vn. (glMapGrid2 only.)

πŸ’– DESCRIPTION πŸ’–

so the way this works: glMapGrid and glEvalMesh are a duo. like, a duo duo. you use them together to efficiently generate and evaluate a whole series of evenly-spaced map domain values. glEvalMesh steps through the integer domain of a one- or two-dimensional grid, and that grid's range is the domain of the evaluation maps that glMap1 and glMap2 specified. teamwork, slay. 🫢

glMapGrid1 and glMapGrid2 specify the linear grid mappings between the i (or i and j) integer grid coordinates, and the u (or u and v) floating-point evaluation map coordinates. if you wanna know the details of how u and v coordinates get evaluated, go read glMap1 and glMap2 β€” that's their lore, not this page's.

πŸŽ€ the 1D one

glMapGrid1 specifies a single linear mapping such that integer grid coordinate 0 maps exactly to u1, and integer grid coordinate un maps exactly to u2. every other integer grid coordinate i gets mapped so that

u=i(u2βˆ’u1)/un+u1

🌸 the 2D one

glMapGrid2 specifies two such linear mappings. one maps integer grid coordinate i=0 exactly to u1, and integer grid coordinate i=un exactly to u2. the other maps integer grid coordinate j=0 exactly to v1, and integer grid coordinate j=vn exactly to v2. other integer grid coordinates i and j are mapped such that

u=i(u2βˆ’u1)/un+u1

v=j(v2βˆ’v1)/vn+v1

and bestie, the mappings that glMapGrid specifies? they get used identically by glEvalMesh and glEvalPoint. same grid, same energy. πŸ’…


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_VALUE is generated if either un or vn is not positive. (we warned you. positive only. πŸ™ˆ)
  • GL_INVALID_OPERATION is generated if glMapGrid is executed between the execution of glBegin and the corresponding execution of glEnd. do NOT do this. it is not the moment. 😭

πŸ”₯ ASSOCIATED GETS πŸ”₯

here's what you can pull back out with glGet, and yes, you gotta pass the right argument:

  • glGet with argument GL_MAP1_GRID_DOMAIN
  • glGet with argument GL_MAP2_GRID_DOMAIN
  • glGet with argument GL_MAP1_GRID_SEGMENTS
  • glGet with argument GL_MAP2_GRID_SEGMENTS

⭐ SEE ALSO ⭐

go read these next, iykyk:

  • glEvalCoord(3G)
  • glEvalMesh(3G)
  • glEvalPoint(3G)
  • glMap1(3G)
  • glMap2(3G)

and that's the page, bestie!! this whole thing lives under the GLMAPGRID(3G) banner β€” that's the title up top and the footer at the very bottom, so you know exactly which manual she came from. go forth and define your mesh, you absolute main character. πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from