Advertisement

NURBS (Evaluators)

Started by March 29, 2005 10:18 PM
2 comments, last by _the_phantom_ 19 years, 5 months ago
I am having some problem using the gluNurbsCurve() function The following code works fine , it draw the curves out but once I add more control points and knots. It wont draw anything. Anyone knows does the gluNurbsCurve function limit to only 4 control points? (I want to draw a curve that has 6 control points. GLfloat ctrlpoints[4][3] = { { -4.0, -4.0, 0.0}, { -2.0, 4.0, 0.0}, {2.0, -4.0, 0.0}, {4.0, 4.0, 0.0}}; GLfloat knots[8] = { 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 }; GLUnurbsObj* nurbs = gluNewNurbsRenderer(); void display(void) { gluBeginCurve(nurbs); gluNurbsCurve(nurbs, 8, knots, 3, &ctrlpoints[0][0], 4, GL_MAP1_VERTEX_3); gluEndCurve(nurbs); } The following is what I tried to do and wont work: GLfloat ctrlpoints[6][3] = { { 2.4, 0.0, 5.4}, { 1.7, 0.0, 4.8}, {1.6, 0.0, 4.3}, {2.0, 0.0, 4.1}, { 2.7, 0.0, 4.4 }, { 3.3, 0.0, 4.9 }}; GLfloat knots[10] = { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; GLUnurbsObj* nurbs = gluNewNurbsRenderer(); void display(void) { gluBeginCurve(nurbs); gluNurbsCurve(nurbs, 10, knots, 3, &ctrlpoints[0][0], 4, GL_MAP1_VERTEX_3); gluEndCurve(nurbs); } Anyone know why?? Thanks
I don't but I suggest you to just don't use GLU to draw NURBS. This method has been declared obsoleted by various vendors (mainly nVIDIA, but I don't think other likes NURBS). By sure means having NURBS around can become really painful when more advanced functionalities are required (such as collision detection).
So, my suggestion is to rethink your design.
In case you really want NURBS, maybe you shall implement them yourself.

Previously "Krohm"

Advertisement
Hi

Thanks for the reply, I manage to get an answer from another forum (OpenGl).
Is to do with the knots, thanks again :)
Cross posted to the OpenGL forum here), I'm closing this one to prevent people getting dragged into it and keeping the other open as it has more replies

This topic is closed to new replies.

Advertisement