PDA

View Full Version : Help with gluNurbsCurve !!

Guilugi
05-27-2004, 01:59 AM
Hi !

I'm currently using OpenGL NURBS functions, to draw audio curves, with many control points.

I'm using gluNurbsCurve() to do it, and it works quite well, but only with 8 control points max !

Is it possible to draw a curve with more control points (50 would be perfect for me), and in that case,what's the corresponding knot vector ?

Guilugi

M.Mortier
05-27-2004, 02:11 AM
A NURBS is a spline, so of course you can split it up into other NURBS.
You're going about it the wrong way, I think.. I assume you are making an 8-order NURBS curve so you can have 8 control points? You should make 5 NURBS splines of order 4 instead. Just look into the theory on what b-splines really are and thne you'll understand. Sorry if you're talking about something else.

M.Mortier
05-27-2004, 02:14 AM
And the knot vector for NURBS of order 4 (you should really only use order 4 for this kind of thing, since it has a smallerl ocal impact when you move control points - actually order 3 might be even more appropriate in this implementation), for 50 control points is :

(0,0,0; 0, 1, 2, ..., 49; 49, 49, 49)
(the ones before and after a semicolon are virtual knots, but they're needed to make the spline open-uniform)
And if you're working with a [0,1] bound you'll have to divide everything by 49.0f of course..

Guilugi
05-27-2004, 03:33 AM
Yeah,

Thanks M.Mortier !
In fact, I do exactly what you wrote, I decompose my spline with 4-control point curves, and I can as many points I want.

But there's a discontinuity problem with these curves.

How can I have a continuous patch ?

Thanks a lot again for your answers, I really was in the wrong way !

Guiluge