I can’t quite seem to get my head around linear animation, as basic as it probably is. I’m just trying to animate a position from a start position to an end position over a given duration. Googling hasn’t helped me here and my algebra skills have abandoned me. How do I do this? I’ve tried a number of different things but I just can’t seem to get it right. Do I need linear interpolation?
Answers can be language agnostic (psuedocode, in your favorite language, whatever really), although I’m working in Javascript.
Yes.
You have distance (d) and duration(t). You also need to decide on a number of frames per second (f). After that it’s just moving d / (t * f) each time.