Your Ad Here

Animation dynamic versus static


The great advantage of programming an animation is that it becomes dynamic. The images are not
defined until run time. 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.



But a coded animation isn’t necessarily interactive. You can take an object and, using code, move it from a
particular position across the screen. Each time the animation is played, the same code runs, causing the
same movement. This is an example of what we'll call a static animation. Each frame, from start to finish,
is predefined. Similar to a movie, you’re watching a predetermined sequence of images that do not change
on another viewing.
But what if you create an object, and again, using code, determine a random point to place it and a
random direction and speed to move it? Now, each time you play the animation, something different
happens. Or, what happens if, when the animation starts, you determine the time of day and month of the
year, and use that data to create a scene—a winter morning, a summer afternoon, visually distinct images
depending on the date the program is run?
Or, maybe you have some factors in your animation that change using input from the keyboard and mouse
while it runs. This enables the user to interact with the objects on the screen, and about as far from static
as you can get.
Perhaps the most interesting aspect of dynamic animation, and the focus of this book, is the application of
real-world mathematics and physics principles to objects in the animation. You're not limited to moving an
object in some random direction; you can also give it some gravity, so that as it moves, it falls down. When
it hits the “ground,” it bounces, but not as high as it started out. Then it eventually settles down and just sits
there. You can also add some user interaction, enabling the user to “pick up” the object with the mouse or
move it around with the keyboard. As the user throws the object around, she gets the feeling of handling a
physical object.


With this kind of animation, the user is no longer a passive recipient of a sequence of frames that plays
out, but has entered an environment you created. You can construct a world that models the physical
constraints of your own, providing a more realistic experience, or, you can completely disregard such
worldly confines. As the programmer, you are free to express your vision as you see fit. These are the joys
of creative coding; by offloading tasks to the computer and having a constantly updating visual display, you
can create rich scenes that involve the viewer in a way no medium in human history has been able to do
before. How long will viewers stay there? They will remain as long as the environment keeps them
interested. The more they interact with it, the more likely they'll come back for more.


0 comments:

Post a Comment

Popular Posts

Recent posts