HTML and CSS Reference
In-Depth Information
Frames as records
The whole concept of frames makes three things possible: storage, transmission, and display. You can't
store, transmit, and display an actual man walking across a room, but you can store many pictures of that
man walking across the room. You can also transmit the images and display them. Thus, you can show an
animation almost anywhere and at any time, as long as you can interpret the stored images and have a
means to display them.
Now, we need a more general definition of what a frame is. So far, we've referred to a frame as a still
image or a drawing. Let's call it a record of a system at a specific point in time. That system can be the
midway point of a man walking across a room; then the record is that image. On the other hand, that
system can be a collection of virtual objects, and the record is their shapes, colors, and positions at a
particular moment in time. Thus, your animation becomes not a series of still images, but rather, it is a
series of image descriptions. Instead of displaying only the image, the computer takes that description,
creates the image from it, and then displays it. You can even take this idea a step further by using
programmed frames.
Programmed frames
Because you have at your disposal a computer that can perform calculations as needed, you don't need a
long list of frame descriptions. You can cut it down to a description of the first frame, and then you follow
some rules for building the subsequent frames. Now the computer is not merely creating an image from a
description; it's creating the description first, creating the image based on this description, and then finally
displaying the image.
Consider how much file space you can save using this approach. Images take up hard disk space and
bandwidth, and 24 images per second will add up fast. If you can decrease that to one description and a
set of rules, you can possibly reduce the file size to a fraction of what it was. Even a complex set of rules
for how the objects should move and react takes up less space than a single medium-sized image. Indeed,
one of the first things people notice about programmed animation is just how small the files are.
Naturally, there is a trade-off. As your system gets larger and your rules get more complex, the computer
must work furiously to calculate the next description, and then it must work additionally to display it. If
you're trying to maintain a particular frame rate, that gives the computer a limited amount of time
(milliseconds) to process it. If the computer can't calculate the scene in time, your frame rate suffers. On
the other hand, image-based animation doesn't care about what's in the scene or how complex it is; it just
shows the next picture, and generally it is right on time.
Dynamic versus static animation
The great advantage of programming an animation is that it becomes dynamic. The images are not
defined until runtime. Instead of watching a predetermined sequence of frames—such as a movie's ending
that will never change no matter how many times you watch it—you can generate new images, effectively
creating a unique visual experience for each viewing. If you calculate an object's position using user-
provided values, such as a mouse cursor, the media can responsively update the display to interact with
the user, creating a level of immersion not capable with other media types.
 
Search WWH ::




Custom Search