GLUNURBSPROPERTY(3G)

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

πŸ’… GLUNURBSPROPERTY β€” okay bestie, let's talk NURBS properties (3G)

Hiiii so this is the page for gluNurbsProperty from the 3G manual, and honestly? It's giving "tiny function, enormous power." Let's get into it. πŸ¦‹


✨ NAME ✨

gluNurbsProperty β€” set a NURBS property. That's it, that's the whole job. πŸŽ€


✨ C SPECIFICATION ✨

void gluNurbsProperty( GLUnurbs* nurb,
                       GLenum property,
                       GLfloat value )

✨ PARAMETERS ✨

  • nurb β€” your NURBS object, bestie. The one you made with gluNewNurbsRenderer. If you don't have one of these yet, we have a problem. 😭
  • property β€” which property you're setting. The valid values are GLU_SAMPLING_TOLERANCE, GLU_DISPLAY_MODE, GLU_CULLING, GLU_AUTO_LOAD_MATRIX, GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, GLU_V_STEP, or GLU_NURBS_MODE. Pick one, queen. πŸ‘‘
  • value β€” the value for that property. It can be a numeric value, or one of GLU_OUTLINE_POLYGON, GLU_FILL, GLU_OUTLINE_PATCH, GL_TRUE, GL_FALSE, GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, GLU_DOMAIN_DISTANCE, GLU_NURBS_RENDERER, or GLU_NURBS_TESSELLATOR. So like, numbers or vibes. Both valid. ✨

✨ DESCRIPTION ✨

So gluNurbsProperty is how you control the properties stored inside a NURBS object. These properties decide how a NURBS curve actually gets rendered. The accepted values for property go like this:

  • GLU_NURBS_MODE β€” set this to either GLU_NURBS_RENDERER or GLU_NURBS_TESSELLATOR. When it's GLU_NURBS_RENDERER, NURBS objects get tessellated into OpenGL primitives and sent straight down the pipeline for rendering. When it's GLU_NURBS_TESSELLATOR, NURBS objects still get tessellated into OpenGL primitives, but the vertices, normals, colors, and/or textures come back to you through a callback interface (see gluNurbsCallback). That means you can cache the tessellated results and do further processing with them. Main character behavior, honestly. πŸ’… The initial value is GLU_NURBS_RENDERER.
  • GLU_SAMPLING_METHOD β€” this one decides how a NURBS surface should be tessellated. value can be one of GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, GLU_DOMAIN_DISTANCE, GLU_OBJECT_PATH_LENGTH, or GLU_OBJECT_PARAMETRIC_ERROR.
    • Set it to GLU_PATH_LENGTH and the surface renders so that the maximum length, in pixels, of the edges of the tessellation polygons is no greater than whatever GLU_SAMPLING_TOLERANCE says.
    • GLU_PARAMETRIC_ERROR means the surface renders so that the value from GLU_PARAMETRIC_TOLERANCE describes the maximum distance, in pixels, between the tessellation polygons and the surfaces they're approximating.
    • GLU_DOMAIN_DISTANCE lets you specify, in parametric coordinates, how many sample points per unit length get taken in the u, v direction.
    • GLU_OBJECT_PATH_LENGTH is like GLU_PATH_LENGTH but view independent β€” the surface renders so the maximum length, in object space, of the edges of the tessellation polygons is no greater than what GLU_SAMPLING_TOLERANCE specifies.
    • GLU_OBJECT_PARAMETRIC_ERROR is like GLU_PARAMETRIC_ERROR but view independent β€” the surface renders so the value from GLU_PARAMETRIC_TOLERANCE describes the maximum distance, in object space, between the tessellation polygons and the surfaces they approximate.

The initial value of GLU_SAMPLING_METHOD is GLU_PATH_LENGTH. Slay. 🌈

  • GLU_SAMPLING_TOLERANCE β€” the maximum length, in pixels or in object space length unit, to use when the sampling method is set to GLU_PATH_LENGTH or GLU_OBJECT_PATH_LENGTH. Heads up though: the NURBS code is conservative when it renders a curve or surface, so the actual length can come out a little shorter than you asked for. πŸ™ˆ The initial value is 50.0 pixels.
  • GLU_PARAMETRIC_TOLERANCE β€” the maximum distance, in pixels or in object space length unit, to use when the sampling method is GLU_PARAMETRIC_ERROR or GLU_OBJECT_PARAMETRIC_ERROR. The initial value is 0.5.
  • GLU_U_STEP β€” how many sample points per unit length get taken along the u axis in parametric coordinates. You need this when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The initial value is 100.
  • GLU_V_STEP β€” how many sample points per unit length get taken along the v axis in parametric coordinate. Also needed when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The initial value is 100.
  • GLU_DISPLAY_MODE β€” value can be GLU_OUTLINE_POLYGON, GLU_FILL, or GLU_OUTLINE_PATCH.

When GLU_NURBS_MODE is set to GLU_NURBS_RENDERER, value defines how a NURBS surface should be rendered. Set value to GLU_FILL and the surface renders as a set of polygons. Set value to GLU_OUTLINE_POLYGON and the NURBS library draws only the outlines of the polygons created by tessellation. Set value to GLU_OUTLINE_PATCH and just the outlines of patches and trim curves defined by the user get drawn.

When GLU_NURBS_MODE is set to GLU_NURBS_TESSELLATOR, value defines how a NURBS surface should be tessellated. When GLU_DISPLAY_MODE is GLU_FILL or GLU_OUTLINE_POLYGON, the NURBS surface tessellates into OpenGL triangle primitives that can be retrieved back through callback functions. If GLU_DISPLAY_MODE is GLU_OUTLINE_PATCH, only the outlines of the patches and trim curves get generated, as a sequence of line strips, and those can be retrieved back through callback functions too.

The initial value is GLU_FILL. ✨

  • GLU_CULLING β€” value is a boolean. Set it to GL_TRUE and it means a NURBS curve should be discarded before tessellation if its control points lie outside the current viewport. The initial value is GL_FALSE.
  • GLU_AUTO_LOAD_MATRIX β€” value is a boolean. When it's GL_TRUE, the NURBS code downloads the projection matrix, the modelview matrix, and the viewport from the GL server to compute sampling and culling matrices for each NURBS curve that gets rendered. And you need those sampling and culling matrices to figure out the tessellation of a NURBS surface into line segments or polygons, and to cull a NURBS surface if it lies outside the viewport.

If this mode is set to GL_FALSE, then your program has to provide a projection matrix, a modelview matrix, and a viewport for the NURBS renderer to use to build those sampling and culling matrices. You do that with the gluLoadSamplingMatrices function. This mode is initially set to GL_TRUE. And listen β€” changing it from GL_TRUE to GL_FALSE does not affect the sampling and culling matrices until gluLoadSamplingMatrices is called. Don't get caught out. 🫢


✨ NOTES ✨

If GLU_AUTO_LOAD_MATRIX is true, sampling and culling may be executed incorrectly if NURBS routines are compiled into a display list. So like… watch out, bestie. πŸ’€

A property of GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, or GLU_V_STEP, or a value of GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, GLU_DOMAIN_DISTANCE are only available if the GLU version is 1.1 or greater. They are not valid parameters in GLU 1.0. Sorry to the 1.0 girlies. 😭

gluGetString can be used to determine the GLU version β€” very useful, very iconic, use it. ⭐

GLU_NURBS_MODE is only available if the GLU version is 1.3 or greater.

The GLU_OBJECT_PATH_LENGTH and GLU_OBJECT_PARAMETRIC_ERROR values for the GLU_SAMPLING_METHOD property are only available if the GLU version is 1.3 or greater.


✨ SEE ALSO ✨

  • gluGetNurbsProperty(3G)
  • gluLoadSamplingMatrices(3G)
  • gluNewNurbsRenderer(3G)
  • gluGetString(3G)
  • gluNurbsCallback(3G)

Okay that's the whole page, babe β€” go forth and tessellate responsibly. πŸ’– This has been GLUNURBSPROPERTY(3G), from the 3G manual section. Mwah. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from