• Advertisement
Sign in to follow this  

Interpolation magic

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

Imagine a body animated with 2 keyframes which needs to be interpolated across using a blend factor. The problem is that the first keyframe isn't known, the only thing you know is that once upon a time the body resided on keyframe 1. If you simply linearly interpolate between the bodys current position and the destination position it will have a curved path and a very high speed when the blend factor is low and a very low speed when the blend factor is high. This is what the euqation looks like atm: Position = ( Target * blendFactor ) + ( CurrentPosition * ( 1.0 - blendFactor ) ) The ideal sollution would create a straight line path and have a constant speed, I don't know if this is at all possible though. Any help appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Do you at least know when the first key frame was?

Share this post


Link to post
Share on other sites
Sadly no, I guess I can create a guesstimate from the speed of the animation in relation to the blend factor though. The problem is that the "real" previous keyframe could've been a combination of out of sync keyframes, there's also the problem of the physics engine affecting the interpolation. I'm very tired atm though and must get this done so I'm not exactly clear in the head hehe. I'm thinking some exponential of some sort applied to the blend factor could at least create a somewhat constant speed, which at least would make it look a lot better.

Share this post


Link to post
Share on other sites
Do you know when the destination key frame is?

Share this post


Link to post
Share on other sites
Position = ( Target * blendFactor ) + ( CurrentPosition * ( 1.0 - blendFactor ) )
blendFactor = 1 / numberOfStepsToGetToTarget

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement