home *** CD-ROM | disk | FTP | other *** search
- MOVIE! a ram animation system
-
- by
-
- Eric Graham
-
- Version 1.01
-
-
-
- The MOVIE! ram animation system consists of three programs that must be
- run from CLI. You will need to be familiar with CLI and with the use of
- a text editor, such as ED, because you will need to write text files to
- control the animation. The three programs are:
-
- DILBM Calculates the difference between two image files.
- PILBM Packs several difference files into a single animation
- file.
- MOVIE Plays back the animation.
-
- To make life easier, I have included a couple of extra programs, DILBMGEN
- and PILBMGEN (and the C source). These programs generate the script files
- for a simple loop animation.
-
- Before you run these programs, make sure that you have sufficient stack
- space. Issue the CLI command
-
- STACK 16000
-
- unless a similar command is in your startup-sequence. Failure to provide
- enough stack space will usually result in the system requester and a visit
- from the Guru.
-
- If you have strange problems, here are some hints:
-
- 1) You must use Kickstart/workbench 1.2.
- Be careful using other utility programs, keyboard
- macros, console filters, etc. If in doubt, return
- to the original Enhancer disk.
- 2) You must have enough memory, a 512K machine
- should play a 200K animation. A 1 meg machine
- will play back about 700K of animation.
- 3) You will need at least 16000 bytes stack space.
- 4) DILBM requires that all images are the same size,
- the must be full screen or overscan (jumbo), and
- they must all use the same palette (see below).
- 5) Check your script files carefully if the movie does
- not play back correctly.
-
- This system differs from other similar programs in several important
- ways:
-
- 1) It is in the public domain. It may be freely copied and
- distributed for non commercial purposes. Upgrades and enhancements may
- be provided from time to time.
-
- 2) It employs J-type animation compression. This is an adaptive
- algorithm that employs numerous different strategies to achieve the best
- compression and fastest playback. Additional strategies will probably
- be added to improve performance still further.
-
- 3) It works with HAM and non-HAM images, either full screen or
- overscan. It also works with European PAL Amigas.
-
-
-
- DILBM
- -----
-
- This program calculates the differences between two images and stores
- the result as a delta file. The program is called with the names of
- three files:
-
- dilbm image1 image2 delta
-
- The two image files must exist. The delta file will be created. The
- delta file represents the data required to convert image1 into image2.
- It is not reversible.
-
- There is an alternate delta format that is reversible, to generate it,
- add an 'x' at the end of the command:
-
- dilbm image1 image2 delta x
-
- Normally, dilbm will display a picture of the differences between the
- images. To suppress this picture, add a 'q' at the end of the command,
- this will make dilbm run slightly faster.
-
- In order for DILBM to work, both images must use the same palette and have
- the same size. Images should either be full size or overscan (jumbo size).
- If the palettes (color maps) differ, or the sizes are not the same, DILBM
- will produce an informative error message, and then print out so much
- information that the error message will scroll off the screen, probably
- before you had a chance to read the message.
-
- Paint programs give you direct control over the palette. Be careful
- that all your images use the same palette.
-
-
- SCULPT 3-D and Animation
- ------------------------
-
- SCULPT 3-D uses a complicated algorithm to assign values to the color
- registers, so two images are unlikely to use the same palette. To force
- SCULPT to use the same palette for several images, later versions have
- some undocumented and hidden features. (If you have an older version,
- and you have sent in your registration card, you will be receiving an
- upgrade).
-
- To activate the hidden commands, click on the down window and type
- control-D. At the prompt, enter the magic number, which is 123.
- Examine the observer menu and you should see the commands: Mode Color
- Lock, Mode Color Unlock, Exposure Lock and Exposure Unlock.
-
- Once Color Lock is set, new images will use the previous palette. A
- palette may be established by making an image with mode color unlock, or
- by loading in an image (with or without color lock). Because the color
- assignment is performed as the image is rendered, slightly different
- results will be obtained if you re-render the same image after locking
- the colors.
-
- SCULPT 3-D also has an automatic exposure facility. If this is allowed
- to operate and change the exposure from frame to frame in an animation,
- then you will not achieve optimum compression. The Exposure Lock
- feature disables automatic exposure determination. The manual override
- will still work, but probably should only be used with the same value
- for each frame. The actual exposure value is calculated when an image
- is made, and is saved as a part of the scene, not as part of an image.
-
- Here is how to generate images for use in an animation:
-
- 1) Render the first image. Save the image and also save the
- scene after the image has been made (so that the exposure
- value is saved).
-
- 2) Turn on both color lock and exposure lock.
- Recalculate the first image. Produce the
- remaining images.
-
- 3) If the sequence is interrupted, for example by a reboot, load
- the first image (to get the palette). Then load the first
- scene (to get the exposure value). Now lock the colors and
- exposure. Start rendering.
-
- NOTE that if the exposure is locked, loading a scene will not affect
- the exposure lock, the exposure value, the color lock or the color
- values. Reading in an image will always change the palette.
-
- The new features have script equivalents:
-
- MODE COLor LOCk
- MODE COLor UNLock
- EXPosure LOCk
- EXPosure UNLock
-
- Here is a sample script file:
-
- load scene "abc0.scene"
- start
- mode color lock
- exposure lock
- start
- save image "abc0.image"
- save scene "abc0.scene"
- exposure lock
- erase all
- load scene "abc1.scene"
- start
- save image "abc1.image"
- erase all
- load scene "abc2.scene"
- start
- save image "abc2.image"
- erase all
- load scene "abc3.scene"
- start
- save image "abc3.image"
- erase all
-
- To continue the sequence, use
-
- load scene "abc0.scene"
- load image "abc0.image"
- mode color lock
- exposure lock
- erase all
- load scene "abc4.scene"
- start
- save image "abc4.image"
- erase all
- load scene "abc5.scene"
- start
- save image "abc5.image"
- erase all
-
- etc.
-
-
- SSG and Animation
- -----------------
-
- Just as with SCULPT, you must force SSG to use the same color palette for
- each frame. This can be done with the command line argument 'r=filename',
- where 'filename is the name of an image that serves to define the palette.
- It need not be a full size image. For example
-
- SSG i=robot1.dat o=palette s=1
- SSG i=robot1.dat o=robot1 r=palette
- SSG i=robot2.dat o=robot2 r=palette
-
- The file 'palette' is a half size image (s=1) that is used to define the
- colors for the images 'robot1' and 'robot2'.
-
- Remember to use TOILBM to convert SSG images into IFF format for use by
- DILBM.
-
-
- PILBM
- -----
-
- This program packs delta files together to create an animation. It
- takes a single argument that is the name of a text file that contains a
- description of the animation. The following format must be followed:
-
- line
- 1 a The name of the animation that is to be produced.
- 2 i The name of the initial image.
- 3 d0 The name of the initial delta file.
- 4 d1 The name of the first delta file.
- 5 d2 The name of the second delta file.
- ...
- n+3 dn The name of the last delta file.
- n+4 * An asterisk to denote the start of sequence control
- n+5 m t m is a delta number and t is a time delay
- n+6 m t
- ...
- m t
-
- The animation works by double buffering, so you must specify two images.
- The file 'i' specifies the first image. The delta file 'd0' defines the
- second image in terms of the first.
-
- The delta file 'd0' is discarded after the second image file is
- constructed. The remaining delta files, d1 to dn are stored in memory.
- When the animation is replayed, the following actions take place:
-
- The first image is displayed on the screen. Then the second image is
- displayed. While the second image is displayed, the first image is
- changed with a delta file. Then it is displayed while the second image
- is modified with another delta file. This process is repeated.
-
- The sequence control determines the order in which the delta files are
- used. The value 'm' determines which delta file is to be used. The
- value t specifies how much time (in jiffies) is to be used for the
- change. If t is negative, then m is used to indicate a transfer to the
- m'th m-t pair. Thus the following sequence
-
- *
- 3 2
- 5 2
- 9 2
- 12 2
- 2 -1
-
- would stand for the following sequence of delta files:
-
- d3 d5 d9 d12 d5 d9 d12 d5 d9 d12 d5 d9 d12 etc.
-
- Not all delta files need to be used (although that would be wasteful)
- and some may be used many times, if the sequence control specifies a
- loop.
-
- Deciding which images to use to construct delta files, and the correct
- sequence of delta files is complicated because of the nature of double
- buffering. Here is an example, suppose that we wish to display images
- in the following sequence:
-
- 15 14 13 12 11 10 9 8 7 8 9 10 11 12 13 14 15 14 13 12 11 etc
-
- then we can use the 'x' type of reversible deltas and compute the
- following files (it is a good idea to place the dilbm commands in a text
- file and use an 'execute' command).
-
- dilbm pic15.image pic14.image dx15-14 x q
- dilbm pic15.image pic13.image dx15-13 x q
- dilbm pic14.image pic12.image dx14-12 x q
- dilbm pic13.image pic11.image dx13-11 x q
- dilbm pic12.image pic10.image dx12-10 x q
- dilbm pic11.image pic9.image dx11-9 x q
- dilbm pic10.image pic8.image dx10-8 x q
- dilbm pic9.image pic7.image dx9-7 x q
- dilbm pic8.image pic8.image dx8-8 x q
- pilbm buildx.script
-
- The file buildx.script contains the following:
-
-
- picx.anim
- phongm15.image
- dx15-14
-
- dx15-13
- dx14-12
- dx13-11
- dx12-10
- dx11-9
- dx10-8
- dx9-7
- dx8-8
- *
- 1 2
- 2 2
- 3 2
- 4 2
- 5 2
- 6 2
- 7 2
- 8 2
- 7 2
- 6 2
- 5 2
- 4 2
- 3 2
- 2 2
- 1 2
- 8 2
- 1 -1
-
-
- Note that the delta file dx8-8 causes no action to take place, so it is
- also used in place of dx14-14.
-
-
- MOVIE
- -----
-
- The movie playback program is particularly simple. Give it the name of
- an animation file. Press the 'escape' key to stop an animation that is
- looping.
-
- The program may also be run from workbench, set the default tool of the
- project (the animation file) to be 'movie'. Alternatively, hold down
- the shift key and click on the project and then while still holding
- down the shift key, double click on the movie icon.
-
-
- DILBMGEN and PILBMGEN
- ---------------------
-
- The first one generates a file for executing DILBM. Call it from CLI
- as follows
-
- DILBMGEN >fff 16
-
- This will create a file called 'fff' that contains commands for executing
- DILBM as needed for a 16 frame animation loop. The image files are
- assumed to be pic0.image, pic1.image, ... pic15.image. Execute the file
- 'fff' as follows:
-
- EXECUTE fff
-
- Use PILBMGEN in a similar way. Call it as follows
-
- PILBMGEN >ggg 16
-
- This will create a file called 'ggg' that contains commands for
- executing PILBM to assemble a 16 frame animation loop. Execute
- the file from PILBM as follows:
-
- PILBM ggg
-
- A file called 'anim' will be created. Play it as follows
-
- MOVIE anim
-
- Good luck!
-