I have both a start and end CATransform3D
that I would like to manually animate between. That is, I would like to calculate the intermediate transform for time t
= 0 (start) to 1 (end). The transforms are a combination of translate and scale, if that matters.
I realize that Apple provides a number of ways to automatically animate from a start to end state, but in my particular use case I actually need to compute the intermediate transform at a given time.
The general case is a stinker. The specific case is easier. Assuming you start with the identity transform I would suggest simply writing code that interpolates the values of your scale and translation setting, creating a new transform for each frame, and then applying that transform. Changes to scale and translate are both mathematically simple. Rotation would be a more expensive (read slower) calculation since it involves trig.