View Full Version : 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 .

ZbuffeR

02-27-2006, 05:16 AM

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.

mikael_aronsson

02-28-2006, 01:56 AM

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.

kata1970

03-07-2006, 05:20 AM

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.

mikael_aronsson

03-09-2006, 10:28 PM

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.

gl_CodER

03-11-2006, 08:24 AM

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

gl_CodER

03-11-2006, 08:26 AM

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

Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.