Jump to content
  • Advertisement
Sign in to follow this  

Cubic interpolation problem

This topic is 5041 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 I discoverd that : // v0 = the point before a // v1 = the point a // v2 = the point b // v3 = the point after b float Cubic_Interpolate(float v0, float v1, float v2, float v3,float x) { float P = (v3 - v2) - (v0 - v1); float Q = (v0 - v1) - P; float R = v2 - v0; float S = v1; return Px3 + Qx2 + Rx + S; } gives NOT the right answer. When the four points is in line like: * * * * the return values will not follow that line, it returns a sine-like wave instead. What can I do to fix that? (The formula above is published in some documents I have read)

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!