Jump to content
  • Advertisement
Sign in to follow this  
Celesa

NURBS (Evaluators)

This topic is 4980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi

Thanks for the reply, I manage to get an answer from another forum (OpenGl).
Is to do with the knots, thanks again :)

Share this post


Link to post
Share on other sites

This topic is 4980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!