Apr 01 QTToolkit
Volume Number: 17
Issue Number: 4
Column Tag: QuickTime Toolkit
An Extremely Goofy Movie
By Tim Monroe
Using Video Overrides and Tweening in Sprite Movies
In the previous QuickTime Toolkit article ("A Goofy Movie" in MacTech, March
2001), we learned how to create some simple sprite movies. We saw that a sprite
track typically contains two kinds of media samples, key frame samples and override
samples. A key frame sample contains the set of images used by all the sprites in the
track (up to the next key frame sample) and information about the initial properties
of those sprites. An override sample contains only information about changes in the
properties of the sprites. It's these changes that allow us to perform sprite animation
with override samples.
In this article, we're going to investigate two ways to perform sprite animation
without using override samples. We'll see how to use a video track as the source for a
sprite's images, and we'll see how to interpolate a sequence of values for a sprite
property. Given a starting value and an ending value, QuickTime is able to figure out,
for any moment in the duration of the animation, what the appropriate value between
those two values should be. This process is called tweening, and the track that contains
the information needed to do the tweening is called a tween track.
Video override tracks and tween tracks are two kinds of modifier tracks, or tracks
whose media data is used to modify data in some other track. Modifier tracks do not
display their data directly in a movie. Rather, that data is used only to supplement or
alter the data in some other track in the movie. A video override track supplements the
data in a sprite track by providing a source of images for one or more sprites in that
track. And a tween track can modify the data in a sprite track by providing a sequence
of settings for one of the properties of a sprite in that track. For example, we can use a
tween track to generate a sequence of horizontal positions for a sprite.
We'll begin by seeing how to use a video track as a source of image data for a sprite.
Then we'll turn our attention to tweening. Tweening is an extremely useful technique
throughout QuickTime, not just in connection with sprite properties. So it will be good
to spend some time getting comfortable building tween tracks.
Our sample application this month builds on last month's QTSprites application, so I've
called it QTSpritesPlus. Figure 1 shows the Test menu of QTSpritesPlus.
Figure 1. The Test menu of QTSpritesPlus