How use the gluNurbsSurface function ?

the function definition is in MSDN:

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
);

My question is : I cann’t understand the function parameters . In the red book, the sknot is 8 and the sorder is 4. But if the sknot is 10 and more in my program , how much the sorder is ?
If I want to define a surface with the function, how should I do ? Can you help me ?

A example is give me best. thinks a lot .

it is Python but samples may help you :
http://pyopengl.sourceforge.net/documentation/manual/gluNurbsSurface.3G.html

I cann’t open the link. Have you anything else?

Tip: type the name of the function in your search box, then press enter.

An ordinary spline surface (or curve) has the following properties:

If the number of control points is x then the number of knots is x + the order of the surface (or curve).

The order is the degree of the surface (or curve) plus 1

The number of knots in itself has nothing to do with the order, to make life simple just remember that the number of control points plus order is the number of knots required, this is true in most cases for splines.

Example:
If you have 10 control points and the order is 3 then you will need a knotvector with 13 knots.

Hi everybody.
I think last opinion from mikael_aronsson is not correct. For 10 control points we cann’t use order as 3. I think we must use order as 11. With order = 3 we receive error : knot multiplicity greater than order of spline.

I think last opinion from mikael_aronsson is not correct. For 10 control points we cann’t use order as 3. I think we must use order as 11. With order = 3 we receive error : knot multiplicity greater than order of spline.
That does not mean that you cannot use order 3, it means that the contents of the knotvector is incorrect, when you create a spline that you want to start and end at the first and last control point you put a few knots with the same value at the begining and end, but you cannot have more then “order” number of multiplicity knots (repeating knot values).

Having 10 control points, 13 knots and a order 3 is no problem at all and works just fine if you setup the knot vector correct.

the gluNurbsSurface provides a method to tesselate/render a continuous surface defined by the NURBS.To understand the parameters u will have to have some backgroup an B-splines … thats where the terms knot points etc come up… its mathematics :slight_smile:

the gluNurbsSurface provides a method to tesselate/render a continuous surface defined by the NURBS.To understand the parameters u will have to have some backgroup an B-splines … thats where the terms knot points etc come up… its mathematics :slight_smile: