Jump to content
  • Advertisement
Sign in to follow this  
Alessandro

Evaluating curve points

This topic is 2038 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

Hi folks, I'd like to ask help about evaluating curve points as displayed in the attached image.

I'm be able to discard points if the curve is straight, comparing angles between each vector segment (left part).

 

I'd like to ask how could I evaluate points so that I can build a spline that passes through initial points (blue ones), and adds a number of green points where needed so that I can get a curve instead of a segmented vector.

 

Thanks

Share this post


Link to post
Share on other sites
Advertisement

If you don't mind a bit of math, you can always use Newton polynomials to build a n-degree polynomial that interpolates n+1 points. I prefer them over Lagrange polynomials or using Neville's scheme simply because they take O(n^2), whereas Newton takes O(n) + some
preprocessing time.

 

I would post an example on how to do this, but I can't get the equation tags to show the formulas and the explanation text. It does involve building a divided difference table to get a polynomial. You can either build a set of parametric equations to evaluate at any parameter, or you can put that parameter back in the divided difference table and compute it from there (faster for sure).

Share this post


Link to post
Share on other sites

Yeah, the natural cubic spline approach is better than mine if you want the curves. This way, you get cubic Bezier curves that are C2 with each other. With Newton polynomials, you'd end up having to convert from polynomial basis to Bernstein basis and then choose a simple knot vector to get it to a NURBS.

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!