Understanding the Laws of Nature


Depending on your learning style, you may find it easier to simply observe and copy patterns of movement or to analyze the underlying principles of force that cause these patterns. Either approach can be effective. Even if you're more of a visual person than a theory-oriented person (as many animators are), an overview of some of the basic principles of physics can help to give you a framework for understanding the limitless variations of animated motion. The stylized interpretations of movement found in motion graphics and cartoons often defy the laws of nature — that's what makes them so entertaining. However, if you don't know the basic physics that dictate motion in reality, it can be more difficult to extrapolate convincing motion to fantastic lengths.

Advanced interactive motion can be designed using physics formulas to define the behavior of objects controlled with ActionScript. Although the math may look a little bit intimidating at first, it's often easier to understand when you can get visual feedback on how the numbers directly affect motion patterns. In fact, more than a few top designers claim to be math-impaired, but the beauty of motion controlled by numbers has given them the incentive to learn (or relearn) some of those scary calculus and physics equations. Spending a little time polishing up your math skills can enable you to efficiently script realistic, organic motion that would be insanely time-consuming, or even impossible, to render manually. Even if you never intend to use ActionScript to define the patterns of motion in your animations, a basic understanding of how physics and math can be used to calculate motion makes it much easier to plot movement and plan your drawings. Math and physics, as with color and type, are a powerful part of the vocabulary of motion graphics. Regardless of how you choose to apply them, these principles can be helpful for planning and modifying animation.

Almost all animated motion can be analyzed or designed using Newton's Laws. If you sat through a science class in high school, these scientific descriptions of how objects interact with force will sound familiar. Of course, in animation you aren't required to obey these laws. In fact, you'll probably create more interesting animations by pushing these laws to the limits or even by inverting them to create objects with unexpected behavior.

Law #1: Inertia

Objects that are at rest will stay at rest, and objects in motion will stay in motion unless acted upon by an unbalanced force. In animation terms, objects should show a change in force if they're going to have a change in motion. This is communicated visually with anticipation and with overlapping actions, as we describe earlier in this chapter. Most animation seems much more lifelike with forgiving transitions. Enable objects to ease in and out of motion and to settle into new positions in your composition. Unless you want them to appear robotic, objects don't just change behavior suddenly without showing some anticipation and delayed secondary animation. You can add an element of surprise to an object's movement by intentionally disregarding inertia. For example, if an object stops cold without any visual indication of a change in force, it will appear jarring and hard, or if a very small object takes a long time to accelerate, it will seem hesitant.

Law #2: Acceleration

The acceleration of an object as produced by a net force is directly proportional to the magnitude of the net force, in the same direction as the net force, and inversely proportional to the mass of the object. In animation terms, speed is dependent on a combination of mass and force; increasing force increases speed, whereas increasing mass decreases speed. An important related concept is terminal velocity. Although most people have heard this term, not everyone can explain what it means. Basically, once an item is falling fast enough for air resistance to be strong enough to prevent gravity from increasing the speed, then it has reached terminal velocity or the maximum speed of its fall. Objects with greater mass take longer to reach terminal velocity so they accelerate for longer, generally hitting the ground while still accelerating. An object with less mass quickly reaches terminal velocity and appears to float to the ground, because it doesn't gain any more speed. Figure 10-8 shows an animation of the classic acceleration test — two objects dropped from the same height.

image from book
Figure 10-8: Acceleration is determined by mass, and objects with more mass take longer to reach terminal velocity.

By modifying the principles of acceleration, you can create whimsical environments where cannonballs might float and feathers crash to the ground (or any other variation you can think of).

Law #3: Action/Reaction Force Pairs

This is the most commonly quoted of Newton's Laws: "For every action there is an equal and opposite reaction." Although this law is often used as a metaphor for human behavior, it was originally intended to explain how forces interact and affect objects. This is the law that explains how far backwards a character may fall when pulling on a rope that breaks. The force is directed along the rope and acts equally on objects at either end of the rope — the end result is that a character literally pushes himself backwards by pulling on the rope, as shown in Figure 10-9.

image from book
Figure 10-9: The force of pulling on a rope causes the character to fly backward when the rope breaks.

This is also the law that explains why a ball bounces back into the air when it strikes the ground. If there weren't any gravity or friction acting on the ball, it would bounce back to the exact height that it originally fell from. The actual result is that the ball reaches only a percentage of its original height with each bounce; this percentage depends on how hard the surface is and how heavy and/or bouncy the ball is. You can plan a realistic series of bounces by using a consistent percentage to calculate the descending height of each bounce. The bounce shown in Figure 10-10 was calculated by using a multiple of 0.5 (or ½) for the distance traveled in each bounce.

image from book
Figure 10-10: A starting pattern for a bounce can be plotted using a consistent multiple to calculate the height of each bounce.

On the CD-ROM 

This bounce will be much improved by adding some easing to make the acceleration more realistic. To see the final result animated, open the bounce50percent.swf file in the ch10 folder of this book's CD-ROM. Ideally, a convincing bounce also includes some stretch 'n squash — one of the most common animation tricks used to make motion look more realistic. We discuss this in more detail in Chapter 14, "Character Animation Techniques."

If you're interested in exploring the formulas for more advanced motion patterns, any basic physics textbook will help you get started. Three useful sources that we recommend for motion designers are

  • Physics for Game Developers, by David M. Bourg (O'Reilly & Associates, 2001).

  • Processing, an open source tool that is being developed to support artists and educators who are interested in learning to work with code structures to create graphics and interactive projects. Although the code is not identical to ActionScript, you will find the examples inspiring and helpful as a beginning step toward using math to describe motion. Visit www.processing.org to learn more. The Learning section of the site includes a growing library of examples with graphics and commented code.

  • Jack's Page, a Web site created by physics teacher Jack Orb to provide information on basic physics and optics for computer-rendered graphics (with sample JavaScript): www.kw.igs.net/~jackord/j6.html#p1.

Web Resource 

We'd like to know what you think about this chapter. Visit www.flashsupport.com/feedback to send us your comments.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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