Hi,
I want to write a program that can smoothly pan and zoom in a photo. It should have keyframes and positions. It should pass each position at the right frame.
Drawing a continuous curve using bezier curves is not hard. The problem comes when animating. If one segment has more frames than the next one there will be a sudden change in speed, which I want to avoid.
TL;DR Does someone have code that allows that kind of animation?
According to
Wikipedia, "In computer graphics, Catmull–Rom splines are frequently used to get smooth interpolated motion between key frames. For example, most camera path animations generated from discrete key-frames are handled using Catmull–Rom splines. They are popular mainly for being relatively easy to compute, guaranteeing that each key frame position will be hit exactly, and also guaranteeing that the tangents of the generated curve are continuous over multiple segments.
"
I've read all the tech notes at
http://algorithmist.net/, downloaded
http://www.algorithmist.net/as3pc.html and
http://www.degrafa.org/code/ but as far as I can tell, there is no keyframe system to do spline animation. I only find formulas for drawing curves.
This seems to be the right direction, but at least in the example all time segments have the same duration, and that ActionScript/MXML code is not that straightforward to translate. I can not try these demos (no Silverlight plug-in) but I think
this is what I want to achieve, done the Microsoft way.
1