GLUNURBSSURFACE(3G)

๐Ÿ“ฆ version 1.1, in centos-stream 9, fedora 43, fedora 44

๐ŸŽ€ NAME ๐ŸŽ€

okay bestie, meet gluNurbsSurface โ€” she defines the shape of a NURBS surface. that's it, that's the job. ๐Ÿ’…


๐Ÿ’– C SPECIFICATION ๐Ÿ’–

fr fr, here's exactly how you call her:

void gluNurbsSurface( GLUnurbs* nurb,
                      GLint sKnotCount,
                      GLfloat* sKnots,
                      GLint tKnotCount,
                      GLfloat* tKnots,
                      GLint sStride,
                      GLint tStride,
                      GLfloat* control,
                      GLint sOrder,
                      GLint tOrder,
                      GLenum type )

โœจ PARAMETERS โœจ

  • nurb โ€” the NURBS object in question, aka the one you made with gluNewNurbsRenderer. your girl. ๐Ÿซถ
  • sKnotCount โ€” how many knots live in the parametric u direction.
  • sKnots โ€” an array of sKnotCount nondecreasing knot values in the parametric u direction. nondecreasing, okay? don't be chaotic.
  • tKnotCount โ€” how many knots live in the parametric v direction.
  • tKnots โ€” an array of tKnotCount nondecreasing knot values in the parametric v direction.
  • sStride โ€” the offset (counted as a number of single-precision floating point values) between successive control points in the parametric u direction, inside control.
  • tStride โ€” the offset (in single-precision floating-point values) between successive control points in the parametric v direction, inside control.
  • control โ€” the array holding all the control points for the NURBS surface. the offsets between successive control points in the parametric u and v directions? those come from sStride and tStride.
  • sOrder โ€” the order of the NURBS surface in the parametric u direction. heads up, the order is one more than the degree, so a surface that's cubic in u has a u order of 4. iconic math.
  • tOrder โ€” the order of the NURBS surface in the parametric v direction. same deal: order is one more than the degree, so a surface cubic in v has a v order of 4.
  • type โ€” the type of the surface. type can be any of the valid two-dimensional evaluator types (like GL_MAP2_VERTEX_3 or GL_MAP2_COLOR_4). so many options, so little time. ๐ŸŒˆ

๐ŸŒธ DESCRIPTION ๐ŸŒธ

Use gluNurbsSurface inside a NURBS (Non-Uniform Rational B-Spline) surface definition to describe the shape of a NURBS surface (before any trimming happens, btw). To mark the beginning of a NURBS surface definition, use the gluBeginSurface command. To mark the end of a NURBS surface definition, use the gluEndSurface command. And listen: call gluNurbsSurface within a NURBS surface definition only. that's the vibe check. ๐Ÿšซ

Positional, texture, and color coordinates get associated with a surface by presenting each as a separate gluNurbsSurface between a gluBeginSurface/gluEndSurface pair. No more than one call to gluNurbsSurface for each of color, position, and texture data can be made within a single gluBeginSurface/gluEndSurface pair. Exactly one call must be made to describe the position of the surface (a type of GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4). one. not zero, not two. one. ๐Ÿ˜ค

A NURBS surface can be trimmed by using the commands gluNurbsCurve and gluPwlCurve between calls to gluBeginTrim and gluEndTrim. โœ‚๏ธ

Note that a gluNurbsSurface with sKnotCount knots in the u direction and tKnotCount knots in the v direction with orders sOrder and tOrder must have (sKnotCount - sOrder) ร— (tKnotCount - tOrder) control points. do the math bestie, she's not flexible on this. ๐Ÿงฎ


๐Ÿฆ‹ EXAMPLE ๐Ÿฆ‹

these commands render a textured NURBS surface with normals, and the texture coordinates and normals are also NURBS surfaces:

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

ate. no crumbs. ๐Ÿ”ฅ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ

  • gluBeginSurface(3G)
  • gluBeginTrim(3G)
  • gluNewNurbsRenderer(3G)
  • gluNurbsCurve(3G)
  • gluPwlCurve(3G)

go read those too, they're all in the same friend group. ๐Ÿ‘‘


okay that's the whole page, and this lil cutie is signed GLUNURBSSURFACE(3G) โ€” that's her name in the footer, living her best life at the bottom of the manual. periodt. ๐Ÿ’–โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from