Sign in to follow this  

knotvalues with gluNurbsCurve ??!?!?!

Recommended Posts

pir    122
Hi! I am trying to draw net shapes with gluNurbsCurve. The reason is that I want the automatic calculated normals so the net shape can be shaded. I am hoping to be able to draw sharp edges by duplicating the controll points. The reason is that the shape is drawn with GL_LINE_STRIP and glVertex in the old code, but I want some kind of normals so I can shade it, and am hoping to produce exact same shape this way with NURBS. But now I have a big problem assigning knot values... Lets say I have four controll points: [-.3, .3, 0], [-.3, .3, 0], [.3, .3, 0], [.3, .3, 0] drawn with degree 1 After what I've read is that I need: number_on_knots = degree + number_of_controll_points + 1. What values should I assign theses values to? What is the strategy? I want to generate knot values automaticly for nurbs with a large number of controll points. And the NURB curve should pass threw the controll points, produce sharp edges if the controll points define sharp edges.

Share this post

Link to post
Share on other sites
Cacks    179

I'm not an extert on NURBS, but know a bit. Try using a uniform knot vector. That is one that starts with a full multipicity knot, then simple knots and ends with a full multiplicity. I think a full multiplicity knot has degree+1 many knots of the same value in OpenGL.


knots[] = {0,0,1,2,3,3};

Hopefully that will get it working

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this