GLUBEGINSURFACE(3G)

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

✨ GLUBEGINSURFACE β€” delimit a NURBS surface definition ✨

okay bestie, so this is the 3G manual page for gluBeginSurface and gluEndSurface, and honestly? it's giving framing device. you put one at the start, one at the end, and everything in between is your NURBS surface. iconic structure, no notes πŸ’…


πŸŽ€ C SPECIFICATION πŸŽ€

void gluBeginSurface( GLUnurbs* nurb )

void gluEndSurface( GLUnurbs* nurb )

🌸 PARAMETERS 🌸

  • nurb β€” the NURBS object you're working with (the one you made with gluNewNurbsRenderer). yes, that one. πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

so here's the vibe. you call gluBeginSurface to mark the beginning of a NURBS surface definition. it's like opening a bracket but make it ✨graphics✨.

after you call gluBeginSurface, you make one or more calls to gluNurbsSurface to define the attributes of the surface. and listen β€” exactly one of those gluNurbsSurface calls has to have a surface type of GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4. not zero, not two. exactly one. the math is mathing and it needs a vertex map, periodt.

then to mark the end of the NURBS surface definition, you call gluEndSurface. close the bracket, we're done here 🫢

Trimming of NURBS surfaces is supported with gluBeginTrim, gluPwlCurve, gluNurbsCurve, and gluEndTrim. head over to the gluBeginTrim reference page for the deets, bestie β€” that's a whole other manual page's worth of lore.

GL evaluators are used to render the NURBS surface as a set of polygons. Evaluator state is preserved during rendering with glPushAttrib(GL_EVAL_BIT) and glPopAttrib(). want the full breakdown of exactly what state these calls preserve? see the glPushAttrib reference page. it's all there, i promise πŸ’œ


🌈 EXAMPLE 🌈

the following commands render a textured NURBS surface with normals; the texture coordinates and normals are also described as NURBS surfaces. nesting? we love to see it:

gluBeginSurface(nobj);
   gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2);
   gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL);
   gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4); gluEndSurface(nobj);

πŸ‘‘ SEE ALSO πŸ‘‘

  • gluBeginCurve(3G)
  • gluBeginTrim(3G)
  • gluNewNurbsRenderer(3G)
  • gluNurbsCurve(3G)
  • gluNurbsSurface(3G)
  • gluPwlCurve(3G)

🧚 lowkey important: gluBeginSurface and gluEndSurface are a matched set. don't leave a surface hanging, bestie β€” always close what you open πŸ’€

and that's the whole page, fr fr πŸ“ this was GLUBEGINSURFACE(3G) β€” the 3G manual, no cap, version and date and all, straight from the source. go forth and delimit some surfaces, main character πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from