GLUNURBSCURVE(3G)

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

✨ GLUNURBSCURVE(3G) ✨

okay bestie, sit down, hydrate, and let me tell you about gluNurbsCurve β€” it's the GLU function that defines the shape of a NURBS curve πŸ’… this one lives in the 3G section of the manual, right next to its GLU girlies.


🌸 C SPECIFICATION 🌸

void gluNurbsCurve( GLUnurbs* nurb,
                    GLint knotCount,
                    GLfloat *knots,
                    GLint stride,
                    GLfloat *control,
                    GLint order,
                    GLenum type )

like, look at her. seven arguments. she's got range. πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • nurb β€” the NURBS object you're working with (the one you made with gluNewNurbsRenderer, duh).
  • knotCount β€” how many knots are chilling in knots. plot twist: knotCount equals the number of control points plus the order. math is math, bestie.
  • knots β€” an array of knotCount nondecreasing knot values. nondecreasing!! don't make it weird.
  • stride β€” the offset between successive curve control points, measured as a number of single-precision floating-point values. yes, in floats, not bytes. read it again. okay good.
  • control β€” a pointer to an array of control points. the coordinates gotta agree with type (that's the last param, we'll get there, patience πŸ’–).
  • order β€” the order of the NURBS curve. order equals degree + 1, so a cubic curve has an order of 4. iconic.
  • type β€” the type of the curve. and here's the tea β˜•: if this curve is defined inside a gluBeginCurve/gluEndCurve pair, then type can be any of the valid one-dimensional evaluator types (stuff like GL_MAP1_VERTEX_3 or GL_MAP1_COLOR_4). but between a gluBeginTrim/gluEndTrim pair? the only valid types are GLU_MAP1_TRIM_2 and GLU_MAP1_TRIM_3. that's it. that's the whole list. no extras, no substitutions. πŸ™…

πŸ¦‹ DESCRIPTION πŸ¦‹

so, use gluNurbsCurve to describe a NURBS curve. that's literally her job and she ate.

when gluNurbsCurve shows up between a gluBeginCurve/gluEndCurve pair, it's describing a curve that's gonna get rendered. positional, texture, and color coordinates get associated by presenting each one as a separate gluNurbsCurve call inside that gluBeginCurve/gluEndCurve pair. and listen β€” no more than one call to gluNurbsCurve for each of color, position, and texture data can be made within a single gluBeginCurve/gluEndCurve pair. exactly one. the limit is real.

⚠️ and exactly one call must be made to describe the position of the curve (a type of GL_MAP1_VERTEX_3 or GL_MAP1_VERTEX_4). one. required. no position, no curve, no slay.

when gluNurbsCurve shows up between a gluBeginTrim/gluEndTrim pair, it's describing a trimming curve on a NURBS surface. if type is GLU_MAP1_TRIM_2, then it describes a curve in two-dimensional (u and v) parameter space. if it's GLU_MAP1_TRIM_3, then it describes a curve in two-dimensional homogeneous (u, v, and w) parameter space. for more discussion about trimming curves, go read the gluBeginTrim reference page, bestie 🫢


🌈 EXAMPLE 🌈

these commands render a textured NURBS curve with normals:

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

see how the position one is there? GL_MAP1_VERTEX_4. exactly one. we love a rule-follower. ✨


πŸ’€ NOTES πŸ’€

to define trim curves which stitch well, use gluPwlCurve. that's the whole note. short, sweet, extremely useful. iykyk.


πŸ‘‘ SEE ALSO πŸ‘‘

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

and that's the whole page, babe β€” GLUNURBSCURVE(3G), straight outta the 3G manual, no date stamp, just vibes and a title line that repeats her name at the bottom like a signature πŸ’– go define some curves. you're gonna do amazing. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from