-by Kelly Murdock
This is the chapter where you make the bold move from photographer to movie director. Animation is more than just moving objects; it's a visual language and one that we all identify with because it mimics real life.
In the last chapter, you learned to set up scenes and create 3D images. Now suppose in that same scene, you move the camera a little bit and capture another image. If you keep doing this and link all the images together, you end up with an animation. Even easier than that, 3D packages have ways to automate the movements within a scene. In this chapter, you'll cover various ways of creating animations with 3D packages and how to embed them in your Web page. Here's what you'll accomplish in this chapter:
You'll be surprised how easy it is to create animations; the difficult part is already behind you. So round out your skills in using these 3D packages and learn how you can display them to the world over the Web. Maybe this is the start to your earning an Oscar.
For this chapter, you'll use trueSpace again. You should be feeling comfortable with this product by now; trueSpace does a good job with the animation basics, and it's easy to learn to use. There are several advanced animation techniques that other packages have, but you'll explore them in Chapter 9, "Creating Advanced 3D Animations for the Web."
Animations can be created very simply from a scene that's already set up by moving the camera around the scene. This is usually called a camera fly-by. In the previous chapter, you learned how to navigate objects. To perform a camera fly-by, you simply move and rotate the camera, but it's really even easier than that.
Because the computer knows the location of all objects in the scene and their relationships to each other, all that's necessary to animate a scene is to position the camera at the locations where the animation should start and end. These positions are known as keyframes.
If you want to move the camera through an intermediate position, then you can do that, too. Just tell the computer where the camera looks at which frame. The computer can then generate all the intermediate frames automatically. Take a look at this example:
Tip |
The type of file you save your animation as really depends on the way you intend to use it on your Web page. In trueSpace, you can save animations as a series of images (BMP, TGA, or JPG) or as a video file (AVI, FLI). If you intend to embed your animations as animated GIF or client-pull animations, then save your file as a series of images. trueSpace automatically attaches a number at the end of each image. Therefore, the first frame is file0000.jpg, the second file0001.jpg, and so on. |
In Figure 5.1, you can see Frame 17 of a camera fly-by of the Chrysler Building. Figure 5.2 shows how the animation progresses. In the background window, you can see the camera and lights.
Figure 5.2: Frames from the Chrysler Building fly-by animation.
Tip |
If your animation is one that loops continuously, make sure the beginning and ending views of the animation match. This makes the animation run smoothly as it loops. |
That's all there is to it. However, being able to move only the camera for fly-bys is rather limited and can grow old quickly. Luckily, trueSpace offers many other means of animating not only models, but even materials, so move on to find out more.
Another way to produce animations is to keep the camera stationary
and move the models. Although this method is slightly more complex,
the animations are made the same way, by using keyframes. Take
a look at how this is done in the following example.
Tip |
Of course, you can still move the camera around as objects move in the scene. A powerful technique is linking the object to a moving object with the Look At tool in the Util Group, then moving the camera independently. |
After loading your models, you need to determine what needs to be animated. For the helicopter in this example, it wouldn't look right if the main and tail rotors didn't spin, so start there:
Caution |
You may be tempted to rotate the rotor beyond 180 degrees, but if you do, the rotor will spin backward to that position. The computer always takes the shortest path between two keyframes. |
There are quite a few techniques in this example, such as moving axes, setting multiple keyframes, and animating object parts. It can be some work, but look at the flexibility you've gained. Using these simple techniques, you can animate any 3D model. Take a look at the finished animation in Figure 5.4.
Figure 5.4: A frame-by-frame look at the helicopter animation.
Any moving object has an associated path. These paths are standard splines and can be saved and loaded from the Path Library. Occasionally, you can edit these paths without having to reset keyframes.
Splines are beneficial because of the power and control you have in manipulating them. Each spline has several control points that define its curvature. By selecting these control points, you can alter the way the curve looks. Each point also has handles, which change the way the curves approach and leave the control point. Handles can be set to make the control point a sharp point or a smooth curve.
Perhaps the best use of paths in trueSpace is attaching them to cameras. This allows you to save your favorite camera movements to be applied wherever you want.
Now to the example. In this example, you'll use a path to create an abstract tube, then match the tube with a camera on a similar path that will fly through the tube:
Figure 5.5: Lining up the camera with its linked path to the tube created from the same path.
The number of frames in this animation depend on the number of points in your spline. Figure 5.6 gives you a small sampling of this animation, but to see the whole thing you'll need to go to the CD-ROM. The one I created had 140 frames, so you might want to create this as an AVI file. In the next chapter, you'll learn how to deal with AVI files by using plug-ins.
Not only can you animate cameras, lights, and models, but with trueSpace you can animate materials on the surface of your objects. This is done by applying a material to an object, then applying a different material at a later keyframe. As the animation progresses, the surface material changes from one material to the other.
You can also apply materials to designated rectangles that are projected on top of the model. The materials for these rectangles can be different from the model's base material. These material rectangles can be animated as well. Think of how a model of a television set could use an animated material rectangle:
The final animation is difficult to show as a figure because the animated material is just a series of blue lines that scroll up the screen (I guess this television set is broken). Figure 5.7 shows the scene as it's being created with the material rectangle in the middle of the television screen.
There are several ways to embed animations in your Web page. With 3D packages, you can create your animation as either a video format, like AVI or QuickTime, or as a series of images, like JPG, BMP, or TGA. In this section, you'll see how to use each of these formats, starting with using animations saved as a series of images.
GIF animations are easy to use because they don't require using plug-ins or special HTML tags. The browser interprets GIF animations the same way it does regular GIF images, so to embed GIF animations you can use the standard <IMG SRC> tag. When the image loads, the images are loaded in successively to create the animation effect. The trick is to create the image in such a way that the frames of the animation line up.
Luckily, there's a simple package that makes it easy to line up the animation frames. The GIF Construction Set is an easy-to-use shareware program, created by the people at Alchemy Mindworks, that automates this process. Try using this program to create a GIF animation of your tube animation from the earlier section:
Figure 5.8 shows the GIF animation for the tube you created earlier.
Embedding the GIF animation is no different than embedding a regular GIF image. The browser will load the different frames automatically. Figure 5.9 shows a sample Web page that uses a GIF animation.
Figure 5.9: A simple GIF animation is used to animate the logo for the Cookie Construction Company.
The idea behind client-pull animations is to load an HTML page, then load another page right over the top of the first, and continue in this manner until the animation is finished. Some people are opposed to client-pull animations because of the strain they can put on the client.
As you can guess, it's probably not a good idea to use a lot of frames for an animation of this type. It works well for small files like logos and such. The steps below show you how to create a client-pull animation.
When the browser encounters the <META> tag, it gets a message to fetch the second HTML file in the series. This continues until the last frame of the animation, where no <META> tag is needed.
Server-push animations are accomplished in the same way as client-pull animations, except the server is in control of sending the series of HTML pages down. The other difference is that a program residing on the server is needed to control the action. These programs are usually written as CGI scripts that reside on the server.
With the ever-changing nature of the Web, these two techniques are slowly being discarded as cheap, dirty, old methods. They are "cheap" because they don't require much work; "dirty" because they task the machines, are inefficient for creating animation, and seldom produce smooth results; and "old" because they've been around for a while. Newer methods are quickly replacing these old dogs, and Chapter 6, "Using Animation Plug-Ins in Your Web Page," covers a number of them. I suppose these methods could be modified, but you can't teach an old dog new tricks (sorry, I couldn't resist).
With this chapter, you've earned the final letter in RMA packages-animation. You've learned about several key concepts of animation that should apply to all 3D packages, and you now have the means to create Web pages with dynamic animations.
I hope you're still anxious to move on because there's still more to learn.
Do I have to use a 3D software package to create animations? | |
No. Traditional animation uses 2D images that are changed slightly from frame to frame. These techniques work fine, but tend to be more time-consuming than the animations produced by 3D software
packages.
The chief benefit of 3D packages is that the computer can calculate in-between images without requiring the artist to redraw every image by hand because it knows the relationship of all objects to each other. If you decide to use a 2D animation package, look for one that has onion skin features. This lets the adjoining images show through onto the current image, which will help you line up the images | |
Are there any 3D packages that can create animations as GIF animations, without requiring you to use another package like the GIF Construction Set? | |
We all know that the Web has sneaked up on us. Many software vendors are working to incorporate export capabilities for their products; in time, you'll likely see such features.
Two products have recently appeared that are focused on producing 3D graphics for the Web. If you're a pc user, check out Asymetrix's 3D Web product; you can use it to create animations as GIF animations. For Mac users, there's Specular's 3D Web Workshop product. | |
What's the difference between 3D animations and video? It seems like it would be easier to record something with a camera than to generate and animate a scene. Which is best for the Web? | |
These are really two very different technologies. Video is real-time and photo-realistic; as such, it requires very large file sizes for low-quality videos. However, there are many places on the Web
where video would be the better choice, such as an interview. It would take far more time to animate a person talking than it would to simply push the record button. On the other hand, it's a little difficult to take a video of aliens on the planet Mars.
3D animation does take some time to set up the initial scene, but many images can be created with computer graphics that would otherwise be impossible (or very dangerous) with video techniques. What's best for the Web depends on what you really want to do. If you plan on having a person talk about a new product, use video, but if you want a space animation with special effects, use 3D animation-and don't rent the space shuttle!
|