The gluNurbsSurface function defines the shape of a NURBS surface.
void gluNurbsSurface( GLUnurbsObj *nobj, GLint sknot_count, GLfloat *sknot, GLint tknot_count, GLfloat *tknot, GLint s_stride, GLint t_stride, GLfloat *ctlarray, GLint sorder, GLint torder, GLenum type );
- The NURBS object (created with gluNewNurbsRenderer).
- The number of knots in the parametric u direction.
- An array of sknot_count nondecreasing knot values in the parametric u direction.
- The number of knots in the parametric v direction.
- An array of tknot_count nondecreasing knot values in the parametric v direction.
- The offset (as a number of single precisionfloating-point values) between successive control points in the parametric u direction in ctlarray.
- The offset (in single precisionfloating-point values) between successive control points in the parametric v direction in ctlarray.
- An array containing control points for the NURBS surface. The offsets between successive control points in the parametric u and v directions are given by s_stride and t_stride.
- The order of the NURBS surface in the parametric u direction. The order is one more than the degree, hence a surface that is cubic in u has a u order of 4.
- The order of the NURBS surface in the parametric v direction. The order is one more than the degree, hence a surface that is cubic in v has a v order of 4.
- The type of the surface. The type parameter can be any of the valid two-dimensional evaluator types (such as GL_MAP2_VERTEX_3 or GL_MAP2_COLOR_4).
Use gluNurbsSurface within a NURBS (Non-Uniform Rational B-Spline) surface definition to describe the shape of a NURBS surface (before any trimming). To mark the beginning of a NURBS surface definition, use the gluBeginSurface function. To mark the end of a NURBS surface definition, use the gluEndSurface function. Call gluNurbsSurface within a NURBS surface definition only.
You associate positional, texture, and color coordinates with a surface by presenting each as a separate gluNurbsSurface between a gluBeginSurface/gluEndSurface pair. Within a single gluBeginSurface/gluEndSurface pair, you can make only one call to gluNurbsSurface for color, position, and texture data. Make exactly one call to describe the position of the surface (a type of GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4).
Note A gluNurbsSurface with sknot_count knots in the u direction and tknot_count knots in the v direction with orders sorder and torder must have (sknot_count - sorder) multipied by (tknot_count - torder) control points.
The following functions render a textured NURBS surface with normals; 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);
Windows NT/2000: Requires Windows NT 3.5 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in Glu.h.
Library: Use Glu32.lib.