home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-22 | 3.7 KB | 84 lines | [TEXT/X_#9] |
- ; Tutorial 3: Animation
- ;
- ; An animation consists of a sequence of frames. Each frame
- ; contains a separate image. The differences between one
- ; image and the next should be fairly small. When the frames
- ; are played back, the viewer will (hopefully) perceive
- ; continuous motion.
- ;
- ; In xModels-2D and xModels-3D, a file that specifies an
- ; animation must begin--except for comments--with the word
- ; "animate" and a speification of the number of frames in
- ; the animation. For example:
-
- animate 30 ; This file defines a 30-frame animation.
-
- ; In an animation, you can have objects that move, rotate,
- ; and change size. If you say "square scale 2:5", for example,
- ; you will get a square that starts in frame 1 with a scale
- ; factor of 2 and ends in the last frame with a scale factor
- ; of 5. As you view the animation, you will see a 2-by-2
- ; square gradually increase in size until it is a 5-by-5
- ; square. The "2:5" represents a range of values, where
- ; each frame will use a different value.
- ;
- ; You can use value ranges in any transformation and even for
- ; the vertices of a polygon. For example:
-
- graysquare scale 5 rotate 0:90 translate -5,5
- blacksquare scale 1:5 translate 5,5
- circle scale 2 translate -7:7,0
- polygon -5,-8 0:-5,-2 0:5,-2 5,-8
-
- ; Render this file to see this animation. The gray square
- ; rotates through a 90-degree angle. The black square
- ; grows from size 1 to size 5. The circle moves across the
- ; window from left to right, and the polygon "morphs" from
- ; a triangle with vertices at (-5,-8), (0,-2) and (5,8)
- ; to a rectangle with vertices at (-5,-8), (-5,-2), (5,-2),
- ; and (5,8).
- ;
- ; The Speed Menu controls the speed at which the animation
- ; is played. At the "Fastest" speed, the animation is played
- ; back as quickly as possible. If you have a slow Mac, this
- ; might actually be no faster than the "Normal" speed.
- ;
- ; Ordinarily, an animation will replay itself over and over.
- ; This behavior is controlled by three options in the
- ; Control Menu: "Play Once Through", "Loop Back to Start",
- ; and "Loop Back and Forth". Only one of these options can
- ; be selected. Experiment with them as an animation is playing
- ; to see how they work.
- ;
- ; The five commands at the top of the Control menu should be
- ; mostly self explanatory. The last command in this menu,
- ; "Save Frames to Memory", needs more explanation about how the
- ; program works.
- ;
- ; When the program draws an image, it actually draws it to
- ; a piece of memory called a "bitmap". A bitmap hols an
- ; image that can be quickly displayed on the screen, so
- ; that you don't have to watch the process of drawing it.
- ; When the "Save Frames to Memory" option is checked, the
- ; program will draw each frame to a separate bitmap. This takes
- ; a lot of memory, and only so many bitmaps can be stored in
- ; memory at one time--and this in turn puts a limit on the
- ; number of frames you can have in an animation. The advantage
- ; is that once all the frames are drawn, they can be displayed
- ; very quickly. (You will notice that the first time a
- ; complex animation is played through, it will run more slowly
- ; than it does after all the frames have been created.)
- ;
- ; You can get around the limitation on the number of frames
- ; by turning off the "Save Frames to Memory" option. Then the
- ; computer will draw each frame one at a time, display it and
- ; discard it. You can have an unlimited number of frames, but
- ; except for fairly simple scenes, you won't be able to play
- ; them as quickly.
- ;
- ; TIP: The program will use a smaller drawing window if the
- ; usual window won't fit on your computer screen. Using a
- ; smaller window lets it have more frames in memory. You
- ; can force the program to use the smaller window by holding
- ; down the Command key as the program stars up.
-