What Is Animation?


Before getting into animation as it relates to games , it's important to understand the basics of what animation is and how it works. Let's begin by asking this fundamental question: What is animation? Put simply, animation is the illusion of movement. Am I saying that every animation you've ever seen is really just an illusion? That's exactly right! And probably the most surprising animated illusion is one that captured attentions long before computers ”the television. When you watch television, you see a lot of things moving around. But what you perceive as movement is really just a trick being played on your eyes.

Animation and Frame Rate

In the case of television, the illusion of movement is created by displaying a rapid succession of images with slight changes in their appearance. The human eye perceives these changes as movement because of its low visual acuity, which means that your eyes are fairly easy to trick into believing the illusion of animation. More specifically , the human eye can be tricked into perceiving animated movement with as low as 12 frames of movement per second. It should come as no surprise that this animation speed is the minimum target speed for most computer games. Animation speed is measured in frames per second (fps), which you've encountered a few times throughout the book already.

Although 12fps is technically enough to fool your eyes into seeing animation, animations at speeds this low often end up looking somewhat jerky. Therefore, most professional animations use a higher frame rate. Television, for example, uses 30fps. When you go to the movies, you see motion pictures at about 24fps. It's pretty apparent that these frame rates are more than enough to captivate your attention and successfully create the illusion of movement.

Unlike television and motion pictures, computer games are much more limited when it comes to frame rate. Higher frame rates in games correspond to much higher processor overhead, so game developers are left to balance the frame rate against the system speed and resources. That is why some games provide different resolution and graphics quality options. By using a lower resolution and simpler graphics, a game can increase its frame rate and generate smoother animations. Of course, the trade-off is a lower resolution and simpler graphics.

When programming animation in Windows games, you typically have the ability to manipulate the frame rate a reasonable amount. The most obvious limitation on frame rate is the speed at which the computer can generate and display the animation frames. Actually, the same limitation must be dealt with by game developers, regardless of the programming language or platform. When determining the frame rate for a game, you usually have some give and take in establishing a low enough frame rate to yield a smooth animation, while not bogging down the processor and slowing the system down. But don't worry too much about this right now. For now, just keep in mind that when programming animation for games, you are acting as a magician creating the illusion of movement.

Making the Move to Computer Animation

Most of the techniques used in computer animation have been borrowed or based on traditional animation techniques developed for animated films . The classic approach to handling traditional animation is to draw a background image separately from the animated objects that will be moving in the foreground. The animated objects are then drawn on clear celluloid sheets so that they can be overlaid on the background and moved independently. This type of animation is referred to as cel animation . Cel animation enables artists to save a great deal of time by only drawing the specific objects that change shape or position from one frame to the next . This explains why so many animated movies have detailed backgrounds with relatively simple animated characters . Computer game sprites , which you learn about a little later in the hour , directly correspond to traditional cel animated objects.

As computer power improved in the last two decades, traditional animators saw the potential for automating many of their hands-on techniques. Computers enabled them to scan in drawings and overlay them with transparency, for example. This is a similar approach to cel animation, but with one big difference: The computer imposes no limitations on the number of overlaid images. Cel animation is limited because only so many cel sheets can be overlaid. The technique of overlaying objects with transparency is a fundamental form of computer game animation, as you soon find out.

graphics/book.gif

Modern animated movies have officially proven that computer animation is for more than just games. Popular movies such as Toy Story , A Bug's Life , and Monsters Inc. are great examples of how traditional animated movies are now being created solely on computers. An even more advanced example of computer animation in movies is the Final Fantasy movie, which uses computer animation to simulate live action graphics.


Although computers have certainly improved upon traditional animation techniques, the animation potential available to the game programmer is far more flexible than traditional techniques. As a programmer, you have access to each individual pixel of each bitmap image, and you can manipulate each of them to your heart's desire .



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net