Exponential Interpolation for Fractal Zoom with Perspective Camera in 3D Space

129 Views Asked by At

I'm creating an endless looping 3D animation of a zoom into a fractal, but I'm having an issue with the interpolation of the camera movement. Essentially it is a heart made out of other hearts, which are made out of further hearts. The ratio between each is exactly 0.06. See this video here (watch on 2x speed). The loop point is every 28 seconds.

https://www.youtube.com/watch?v=bUg-jAqBZtc

I'm trying to keep the perceived camera motion constant, but in order to do that I need to use exponential interpolation from the starting point (100,000 units away on the z axis) to the ending point (6,000 units away on the z axis). The way I'm doing this requires an interpolation function $f:[0,1]\rightarrow[0,1]$ of the form:

$$f(x) = a e^{bx}+c$$ where $$b=ln\left(\frac{1}{a}+1\right)$$ and $$c=-a$$ with $b$ and $c$ chosen to satisfy $f(0)=0$ and $f(1)=1$. To simplify, $f(x)$ is only going from zero to one above and I can scale and translate it to make it interpolate between two arbitrary points as necessary. In this case $x$ represents time as a percentage of animation up to the loop point, where 0 implies 0 seconds and 1 implies 28 seconds.

The only problem I have, is that I don't know what constraint to place in order to calculate $a$. So I'm left with this free variable that controls the speed of the zoom, but I don't know what it needs to be to get the perceived motion at the beginning of the animation to be the same as the end.

You'll see in my video at exactly 28 seconds the speed changes. This is because I have the wrong $a$ value. The perceived speed at the beginning of the animation is slightly slower than at the end, so you see an abrupt slowdown right at the 28 second mark (the loop point).

My thought was that the derivative of the interpolation function needs to be the same at time 0 and at time 1 $f'(0)=f'(1)$. But that doesn't make sense because it would imply a linear interpolation rather than exponential, which definitely doesn't work because that results in the zoom appearing to speed up over time.

I'm thinking this doesn't work because it has something to do with the camera being a perspective camera, so maybe a factor of a half or a fourth works its way into the derivative calculation somewhere. I haven't tested it yet, but maybe I need something along the lines of $f'(0)=f'(1)/4$ instead. I'm not sure.

Any thoughts on what the third constraint needs to be in order to solve for $a$?