## Transformation Matrix Interpolation math issue EDIT

Started by Exempt, March 01, 2015, 22:54:38

#### Exempt

Edit: When trying to interpolate between two frames what is a good way to come up with the value to interpolate by? I can't seem to get a good 0-1 value worked out right. I have a time variable that resets to 0 when it's larger than the last frames time, the current frame and the next frame. I thought it would be as simple as value = ((currentFrameTime+time) / nextFrameTime) * 1; //or time. I've tried this in a ton of different ways with the above being the closest to working but it's not right.  So, my goal here is with the currentFrameTime, nextFrameTime and the actual time passed to come up with a number between 0 and 1 based on the percent time is between current and next frame times.. -.-Ã¯Â»Â¿

Edit: (frameTime / nextFrame) * time; seems to give the results 0-1 accurately but now I've still got a choppy animation. If anyone has some experience with this please let me know. nvm this isn't right I think my whole issue is I need to calculate this part right.

Edit2: I was messing around with it more but I'm still unsure of the issue. If you look at this picture(I know it's wierd looking) it's a picture of all the places the arm is moving during my animation, it goes smooth for a bit then jumps and repeats that. I can't figure out what might be causing it unless the lerp or slerp is wrong or maybe I'm somehow apply it wrong?

I'm trying to interpolate between frames of animation. So far all of the sources I've found are telling me to get the interpolation value like so..which is not returning the needed 0-1 value.

I need to get a 0-1 value based on how close the "time" is to the "nextFrame" time.
nextFrame is the next frames time key, frameTime is the current frames time key in a loop thru all the frames.

For the interpolation functions

The full animation function I'm using for testing. This is probably hard to figure out and I don't think it really matters much because I think the real issue is in calculating the value to interpolate by...