home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-22 | 2.1 KB | 53 lines | [TEXT/X_#9] |
- ; Tutorial 6: Segmented Animations
- ;
- ; The animations in the previous tutorials each consist of a
- ; single sequence of frames. It is possible to create an
- ; animation that consits of two or more sequences of frames,
- ; sort of glued together. I call each sequence of frames a
- ; segment of the animation. For example:
-
- animate 15 15 15 15 ; Make an animation consisting of
- ; four sequences of 15 frames each,
- ; for a total of 60 frames.
-
- ; As you can see, you just list the number of frames in
- ; each segment. These numbers don't have to be the same.
- ; Then, instead of using a single range of values such as
- ; "1:5", you use a multiple range such as "1:5:2:7:3".
- ; This specifies that the value should range from 1 to 5
- ; during the first segment, then from 5 to 2 during the
- ; second segment, then from 2 to 7 during the third, then
- ; from 7 to 3 during the fourth and final segment.
- ; Ordinarily, there should be as many colons as as there are
- ; sequences of frames. (You can't have more. If you have
- ; fewer, the last value will be used in all remaining
- ; segments.)
- ;
- ; Here, for example, is a square that moves along the four
- ; sides of a diamond during the four segments:
-
- blacksquare translate -9:0:9:0:-9, 0:9:0:-9:0
-
- ; Sometimes you want an object to move continuously throughout
- ; two or more segments. If you omit the number between two
- ; colons, the computer will "smooth over" the boundary
- ; between the two segments. For example:
-
- blackcircle xtranslate -9
- rotate 0::::-360 ; Rotate once around the point (0,0)
- ; over the course of all four segments.
- ; (The rotation is clockwise because of
- ; the negative sign.)
- circle scale 18 ; The black circle's center moves along
- ; this circle
-
- ; Finally, here is a cute example of a square "morphing"
- ; into a smaller square:
-
- graypolygon
- -6:-2:-2:-2:-2, 6:2:2:2:2
- 6:6:2:2:2, 6:6:2:2:2
- 6:6:6:2:2, -6:-6:-6:-2:-2
- -6:-6:-6:-6:-2, -6:-6:-6:-6:-2
-
-