Jump to content
  • Advertisement
Sign in to follow this  
Silex

curve to fit a series of points

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

Advertisement
Why do you need to fit the points? Do you need to interpolate or extrapolate? Does it matter if your curves are piecewise second order continuous? First order continuous?

Share this post


Link to post
Share on other sites
it's for interpolation, and the curve needs to hit all points on the path. the problem i'm having is how to generate the control points.

Share this post


Link to post
Share on other sites
Well, both a polyline and a b-spline will hit all points on the path. But they look completely different; a polyline is made up of straight lines with sharp bends at the points (what SiCrane was talking about with first-order continuity) whereas a b-spline is smoother. Use whatever curve formulation fits the visual results you're trying to achieve.

Share this post


Link to post
Share on other sites
bsplines it is then. how do you generate the control points for the curve to pass through all the points on the path, though?

Share this post


Link to post
Share on other sites
You can basically solve a system of equations which sets the vertices as the internal knots of the spline.

Alternatively, BTW, you could use a bezier spline, with the tangent for a point P(n) equal to (P(n+1)-P(n-1))/2. I forget what this method is called..... someone chime in?

Share this post


Link to post
Share on other sites
http://www.cubic.org/docs/hermite.htm

found this, sounds like catmull-rom is what i'm after. can anyone confirm this?

Share this post


Link to post
Share on other sites
Catmull-Rom splines are equivalent to Bezier curves with the tangent generation I described.

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!