Jump to content
  • Advertisement
Sign in to follow this  
xargon123

approximate a curve using splines

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

Hello everyone, I am currently facing a problem where I need to come up with a function that passes through a given set of points. So, I have the data points and I need to fit a spline with minimum number of control points that maintains the shape with a given error tolerance. I guess I am looking for approximating splines that will give the given shape. However, I have no idea on where to even start. I looked at a book which talks about wavelet decomposition of the splines to lower dimensions but I could not follow the mathematics. Does anyone have any idea on how one can go about it? I would be really grateful. I need to code something up quite fast and need your help! Thanks, xarg

Share this post


Link to post
Share on other sites
Advertisement
I believe Dave Eberly's 3D Game Engine Design book has this information - and perhaps more importantly to you a free downloadable source implementation at: www.geometrictools.com

The book is worth it's weight in gold, so I would highly recommend it!

Share this post


Link to post
Share on other sites
Cool! I will try and look it up! Would you happen to have a copy of the book and know which chapter to focus on?

xarg

Share this post


Link to post
Share on other sites
Also check out: Game Programming Gems 4.
Section: 2.4 Nonuniform Splines by Thomas Lowe

Since you're going through points (not just near them), you'll want to pick one of the following:

Catmull-Rom
Natural cubic
Rounded nonuniform
Smooth nonuniform

Share this post


Link to post
Share on other sites
The TI83 can do this in two dimensions, adding a third shouldn't be too bad :)

https://nrich.maths.org/discus/messages/67613/70220.html?1152646145

Share this post


Link to post
Share on other sites
Hello everyone,

This is another question about using splines to approximate curves.

I have now gone through the relevant chapters in Dave Eberly's book and have a decent idea on how to make it work with the B-splines

So, the B-splines are given as:

X(u) = summation[i=0...n] N(i, d) Q(i)

So, the nice thing about the B-splines is that it can be broken down as the linear combination of these knot vectors with the control points. So, I can now arbitrarily choose however number of control points and try to do a least square fit with my given surface. The process is calculating the above quantity for the sample time u.

Now, what I want to know is whether such a basis exists for a Catmull Rom Spline as well. Can I do the same thing with a catmull-rom spline where given the degree and the number of control points that I wish to use, I am able to do express the evaluation function as above. Since, I am approximating a surface, I would like to decide how many control points I want to use and somehow express the evaluation function in terms of some basis function and this control point vector.

So, basically it boils down to use Catmull Rom splines as an approximating spline rather than an interpolating one.

I would really appreciate your help.

Cheers,
xarg

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!