HTML and CSS Reference
In-Depth Information
Chapter 5
Velocity and Acceleration
What we'll cover in this chapter:
Velocity
Acceleration
Well, congratulations! You made it to the point in the topic where the action finally starts. This means that
(a) you persevered through all the chapters so far, (b) you skimmed over the previous chapters and felt
like you knew enough of it to get by, or (c) you got bored and jumped ahead. However it happened, here
you are. Just remember, if you start having trouble, you can probably find help in an earlier chapter.
This chapter starts with basic motion: velocity, vectors, and acceleration. These concepts are used for
almost every bit of animation code you will write from here on out.
Velocity
The most basic property of something that moves is velocity. Many people equate the term velocity with
speed. That's part of it, but only part. The concept of velocity contains an important second factor:
direction. That is pretty much our layman's definition for velocity: speed in a particular direction. Let's look
at exactly how this definition differs from simple speed.
If you got in a car at point X and drove 30 miles per hour for one hour, it would be difficult to find you. On
the other hand, if you drove due north for one hour at the same speed, we would know precisely where
you are. This is important in animation, because you need to know where to put your object. It's fine to say
an object is moving at a certain speed, but you're going to need some specific x, y coordinates to assign to
it on each frame to give it the illusion of motion. This is where velocity comes in. If you know where
 
Search WWH ::




Custom Search