Jump to content
  • Advertisement
Sign in to follow this  
big grinder

Interpolation

This topic is 3902 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 know the forumla for basic linear interpolation is: x0 + (s * (x1 - x0)). I cannot for the life of me remember how to extend the function to include the y space and then the y/z space. I know it involves y0, y1, t, z0, z1, u. Any help with this would be appreciated. Thanks

Share this post


Link to post
Share on other sites
Advertisement
It's the same:

x = x0 + (s * (x1 - x0))
y = y0 + (s * (y1 - y0))
z = z0 + (s * (z1 - z0))


Or just let x0 and x1 be vectors.

Share this post


Link to post
Share on other sites
I realize that much...so say you have all the values for:

x = x0 + (s * (x1 - x0))

and

y = y0 + (t * (y1 - y0))

Isn't there a way to combine the two in some sort of formula to do quadratic interpolation?

Share this post


Link to post
Share on other sites
do you mean a spline by quadratic interpolation?
In this case you have 3 control points: p1,p2,p3
( each point contains x,y,z like p1.x of course )

The basic formula is f(x)= p1 * (1-x)^2+p2*(2*x*(1-x))+p3*x^2 , x = 0..1
Another way to write it is f(x) = lerp (lerp (p1,p2,x),p3,x) , x = 0..1

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!