Jump to content
  • Advertisement
Sign in to follow this  
mjs1

NURBS curve u spacing

This topic is 4841 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'm writing some basic NURBS routines and am running into a small problem getting regular spacing of the points generated along the curve's u direction. I increment u by the same amount each time, but the spacing is different toward the two ends of the curve than at the center. This uneven spacing only happens when I deal with nonlinear (degree greater than 1) curves. So for example, a degree 1 curve, when sampled at 5 evenly-spaced u divisions, looks like this when rendered as points: ..... When this same curve is raised to degree 3, the u divisions are no longer evenly spaced: . ... . The only time I can get perfectly even spacing on a nonlinear curve is if the number of u divisions is equal to the degree of the curve+1. So for example, 4 u divisions on a degree 3 curve looks even: .... I am using a standard knot vector, and the curve is properly interpolating the end points. The only problem is the evenness in spacing. I have tried two different routines to calculate the basis function-derived weights for the control points and got the same exact uneven spacing. So at this point I'm wondering if this is something inherent in the b-spline basis functions (I get the same uneven spacing whether the curves are true NURBS curves or whether they are just basic b-splines, so the weighting is not the problem) and if there is something special you have to do in order to get a nice, even spacing. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
There is no mathematical way to guarentee equal spacing. This is a property of those algorithms. If you want equal spacing you'll just have to calculate the exact value of u iteratively.

Share this post


Link to post
Share on other sites
Thanks, Rick!

I went through the calculations for the basis function control point weights by hand and got the same results my code was giving me. So it seems like it's doing what it's supposed to be doing...

Share this post


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