GLUBEGINCURVE(3G)

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

πŸ’– GLUBEGINCURVE β€” bestie, we're drawing a NURBS curve πŸ’–

okay so this is page GLUBEGINCURVE from the 3G manual section, and it's a two-for-one deal: gluBeginCurve and gluEndCurve, the lil matched set that opens and closes a NURBS curve definition. they're the parentheses of the curve world fr fr πŸ’…


✨ NAME ✨

gluBeginCurve, gluEndCurve β€” delimit a NURBS curve definition πŸŽ€


🌸 C SPECIFICATION 🌸

void gluBeginCurve( GLUnurbs* nurb )

void gluEndCurve( GLUnurbs* nurb )

πŸ¦‹ PARAMETERS πŸ¦‹

  • nurb β€” Specifies the NURBS object (created with gluNewNurbsRenderer). it's your lil NURBS bestie, you gotta make it first with gluNewNurbsRenderer or there's nothing to hold onto 🫢

πŸ‘‘ DESCRIPTION πŸ‘‘

ok so gluBeginCurve is literally just the "hey we're starting a NURBS curve definition now" flag. that's the whole job. queen of setting the scene ✨

after you call gluBeginCurve, you go make one or more calls to gluNurbsCurve to define the attributes of the curve. and here's the non-negotiable part, no cap: exactly one of those gluNurbsCurve calls has to have a curve type of GL_MAP1_VERTEX_3 or GL_MAP1_VERTEX_4. exactly one. not zero, not two. one. πŸ’€

then to mark the end of the NURBS curve definition, you call gluEndCurve. close the loop, wrap it up, periodt πŸŽ€

GL evaluators are what actually do the rendering here β€” they render the NURBS curve as a series of line segments. and while that's happening, evaluator state is preserved with glPushAttrib(GL_EVAL_BIT) and glPopAttrib(). if you wanna know exactly which state those calls preserve, go read the glPushAttrib reference page, she's got the receipts πŸ“œ


🌈 EXAMPLE 🌈

the following commands render a textured NURBS curve with normals; texture coordinates and normals are also specified as NURBS curves πŸ‘‡

gluBeginCurve(nobj);
   gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2);
   gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL);
   gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4); gluEndCurve(nobj);

see that? three gluNurbsCurve calls, and the vertex one is there β€” GL_MAP1_VERTEX_4 β€” so we're valid πŸ’–


πŸ’œ SEE ALSO πŸ’œ

  • gluBeginSurface(3G), gluBeginTrim(3G), gluNewNurbsRenderer(3G), gluNurbsCurve(3G), glPopAttrib(3G), glPushAttrib(3G)

and that's the whole page bestie!! this was GLUBEGINCURVE(3G), straight out of the 3G manual, and honestly? iconic. go forth and close your curves properly, mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from