I have a graph, generated by a function, and it zooms itself in and out automatically, depending on the value of the function. I already have the graphing tools and I can display any x,y,width,height at high resolution.
I tried just snapping to the right spot:
x = target_x
y = target_y
width = target_width
height = target_height
But it's too jumpy. It's hard to tell what part was zoomed in/out.
I also tried doing this:
orig_x = x //ditto for y, width, height, etc
for i=1 to 10
x = i/10*new_x + i/10*orig_x
wait 25ms
It's smoother but the first step is still too jumpy. If orig_x is 10 and new_x is 1 million then the first jump is too big, near 1,000,000%. Last jump is just 10%, however. A geometric progression is even better but if I have to switch directions mid-zoom the steps are jumpy.
What would be the best effect to use?