home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 079.lha / movie.doc < prev    next >
Encoding:
Text File  |  1986-11-20  |  11.9 KB  |  377 lines

  1.                       MOVIE! a ram animation system
  2.  
  3.                                    by
  4.  
  5.                                Eric Graham
  6.  
  7.                               Version 1.01
  8.  
  9.  
  10.  
  11. The MOVIE! ram animation system consists of three programs that must be
  12. run from CLI.  You will need to be familiar with CLI and with the use of
  13. a text editor, such as ED, because you will need to write text files to
  14. control the animation.  The three programs are:
  15.  
  16.         DILBM   Calculates the difference between two image files.
  17.         PILBM   Packs several difference files into a single animation
  18.                 file.
  19.         MOVIE   Plays back the animation.
  20.  
  21. To make life easier, I have included a couple of extra programs, DILBMGEN
  22. and PILBMGEN (and the C source).  These programs generate the script files
  23. for a simple loop animation.
  24.  
  25. Before you run these programs, make sure that you have sufficient stack
  26. space.  Issue the CLI command
  27.  
  28.         STACK 16000
  29.  
  30. unless a similar command is in your startup-sequence.  Failure to provide
  31. enough stack space will usually result in the system requester and a visit
  32. from the Guru.
  33.  
  34. If you have strange problems, here are some hints:
  35.  
  36.         1)  You must use Kickstart/workbench 1.2.
  37.             Be careful using other utility programs, keyboard
  38.             macros, console filters, etc.  If in doubt, return
  39.             to the original Enhancer disk.
  40.         2)  You must have enough memory, a 512K machine
  41.             should play a 200K animation.  A 1 meg machine
  42.             will play back about 700K of animation.
  43.         3)  You will need at least 16000 bytes stack space.
  44.         4)  DILBM requires that all images are the same size,
  45.             the must be full screen or overscan (jumbo), and
  46.             they must all use the same palette (see below).
  47.         5)  Check your script files carefully if the movie does
  48.             not play back correctly.
  49.  
  50. This system differs from other similar programs in several important
  51. ways:
  52.  
  53.     1) It is in the public domain.  It may be freely copied and
  54. distributed for non commercial purposes.  Upgrades and enhancements may
  55. be provided from time to time.
  56.  
  57.     2) It employs J-type animation compression.  This is an adaptive
  58. algorithm that employs numerous different strategies to achieve the best
  59. compression and fastest playback.  Additional strategies will probably
  60. be added to improve performance still further.
  61.  
  62.     3) It works with HAM and non-HAM images, either full screen or
  63. overscan.  It also works with European PAL Amigas.
  64.  
  65.  
  66.  
  67. DILBM
  68. -----
  69.  
  70. This program calculates the differences between two images and stores
  71. the result as a delta file.  The program is called with the names of
  72. three files:
  73.  
  74.         dilbm image1 image2 delta
  75.  
  76. The two image files must exist.  The delta file will be created.  The
  77. delta file represents the data required to convert image1 into image2.
  78. It is not reversible.
  79.  
  80. There is an alternate delta format that is reversible, to generate it,
  81. add an 'x' at the end of the command:
  82.  
  83.         dilbm image1 image2 delta x
  84.  
  85. Normally, dilbm will display a picture of the differences between the
  86. images.  To suppress this picture, add a 'q' at the end of the command,
  87. this will make dilbm run slightly faster.
  88.  
  89. In order for DILBM to work, both images must use the same palette and have
  90. the same size.  Images should either be full size or overscan (jumbo size).
  91. If the palettes (color maps) differ, or the sizes are not the same, DILBM
  92. will produce an informative error message, and then print out so much
  93. information that the error message will scroll off the screen, probably
  94. before you had a chance to read the message.
  95.  
  96. Paint programs give you direct control over the palette.  Be careful
  97. that all your images use the same palette.
  98.  
  99.  
  100. SCULPT 3-D and Animation
  101. ------------------------
  102.  
  103. SCULPT 3-D uses a complicated algorithm to assign values to the color
  104. registers, so two images are unlikely to use the same palette.  To force
  105. SCULPT to use the same palette for several images, later versions have
  106. some undocumented and hidden features.  (If you have an older version,
  107. and you have sent in your registration card, you will be receiving an
  108. upgrade).
  109.  
  110. To activate the hidden commands, click on the down window and type
  111. control-D.  At the prompt, enter the magic number, which is 123.
  112. Examine the observer menu and you should see the commands: Mode Color
  113. Lock, Mode Color Unlock, Exposure Lock and Exposure Unlock.
  114.  
  115. Once Color Lock is set, new images will use the previous palette.  A
  116. palette may be established by making an image with mode color unlock, or
  117. by loading in an image (with or without color lock).  Because the color
  118. assignment is performed as the image is rendered, slightly different
  119. results will be obtained if you re-render the same image after locking
  120. the colors.
  121.  
  122. SCULPT 3-D also has an automatic exposure facility.  If this is allowed
  123. to operate and change the exposure from frame to frame in an animation,
  124. then you will not achieve optimum compression.  The Exposure Lock
  125. feature disables automatic exposure determination.  The manual override
  126. will still work, but probably should only be used with the same value
  127. for each frame.  The actual exposure value is calculated when an image
  128. is made, and is saved as a part of the scene, not as part of an image.
  129.  
  130. Here is how to generate images for use in an animation:
  131.  
  132.         1) Render the first image.  Save the image and also save the
  133.            scene after the image has been made (so that the exposure
  134.            value is saved).
  135.  
  136.         2) Turn on both color lock and exposure lock.
  137.            Recalculate the first image. Produce the
  138.            remaining images.
  139.  
  140.         3) If the sequence is interrupted, for example by a reboot, load
  141.            the first image (to get the palette).  Then load the first
  142.            scene (to get the exposure value).  Now lock the colors and
  143.            exposure.  Start rendering.
  144.  
  145. NOTE that if the exposure is locked, loading a scene will not affect
  146. the exposure lock, the exposure value, the color lock or the color
  147. values.  Reading in an image will always change the palette.
  148.  
  149. The new features have script equivalents:
  150.  
  151.                         MODE COLor LOCk
  152.                         MODE COLor UNLock
  153.                         EXPosure LOCk
  154.                         EXPosure UNLock
  155.  
  156. Here is a sample script file:
  157.  
  158. load scene "abc0.scene"
  159. start
  160. mode color lock
  161. exposure lock
  162. start
  163. save image "abc0.image"
  164. save scene "abc0.scene"
  165. exposure lock
  166. erase all
  167. load scene "abc1.scene"
  168. start
  169. save image "abc1.image"
  170. erase all
  171. load scene "abc2.scene"
  172. start
  173. save image "abc2.image"
  174. erase all
  175. load scene "abc3.scene"
  176. start
  177. save image "abc3.image"
  178. erase all
  179.  
  180. To continue the sequence, use
  181.  
  182. load scene "abc0.scene"
  183. load image "abc0.image"
  184. mode color lock
  185. exposure lock
  186. erase all
  187. load scene "abc4.scene"
  188. start
  189. save image "abc4.image"
  190. erase all
  191. load scene "abc5.scene"
  192. start
  193. save image "abc5.image"
  194. erase all
  195.  
  196. etc.
  197.  
  198.  
  199. SSG and Animation
  200. -----------------
  201.  
  202. Just as with SCULPT, you must force SSG to use the same color palette for
  203. each frame.  This can be done with the command line argument 'r=filename',
  204. where 'filename is the name of an image that serves to define the palette.
  205. It need not be a full size image.  For example
  206.  
  207. SSG i=robot1.dat o=palette s=1
  208. SSG i=robot1.dat o=robot1 r=palette
  209. SSG i=robot2.dat o=robot2 r=palette
  210.  
  211. The file 'palette' is a half size image (s=1) that is used to define the
  212. colors for the images 'robot1' and 'robot2'.
  213.  
  214. Remember to use TOILBM to convert SSG images into IFF format for use by
  215. DILBM.
  216.  
  217.  
  218. PILBM
  219. -----
  220.  
  221. This program packs delta files together to create an animation.  It
  222. takes a single argument that is the name of a text file that contains a
  223. description of the animation.  The following format must be followed:
  224.  
  225.         line
  226.           1     a     The name of the animation that is to be produced.
  227.           2     i     The name of the initial image.
  228.           3     d0    The name of the initial delta file.
  229.           4     d1    The name of the first delta file.
  230.           5     d2    The name of the second delta file.
  231.           ...
  232.           n+3   dn    The name of the last delta file.
  233.           n+4   *     An asterisk to denote the start of sequence control
  234.           n+5   m t   m is a delta number and t is a time delay
  235.           n+6   m t
  236.           ...
  237.                 m t
  238.  
  239. The animation works by double buffering, so you must specify two images.
  240. The file 'i' specifies the first image.  The delta file 'd0' defines the
  241. second image in terms of the first.
  242.  
  243. The delta file 'd0' is discarded after the second image file is
  244. constructed.  The remaining delta files, d1 to dn are stored in memory.
  245. When the animation is replayed, the following actions take place:
  246.  
  247. The first image is displayed on the screen.  Then the second image is
  248. displayed.  While the second image is displayed, the first image is
  249. changed with a delta file.  Then it is displayed while the second image
  250. is modified with another delta file.  This process is repeated.
  251.  
  252. The sequence control determines the order in which the delta files are
  253. used.  The value 'm' determines which delta file is to be used.  The
  254. value t specifies how much time (in jiffies) is to be used for the
  255. change.  If t is negative, then m is used to indicate a transfer to the
  256. m'th m-t pair.  Thus the following sequence
  257.  
  258.                 *
  259.                 3  2
  260.                 5  2
  261.                 9  2
  262.                 12 2
  263.                 2  -1
  264.  
  265. would stand for the following sequence of delta files:
  266.  
  267.         d3 d5 d9 d12 d5 d9 d12 d5 d9 d12 d5 d9 d12 etc.
  268.  
  269. Not all delta files need to be used (although that would be wasteful)
  270. and some may be used many times, if the sequence control specifies a
  271. loop.
  272.  
  273. Deciding which images to use to construct delta files, and the correct
  274. sequence of delta files is complicated because of the nature of double
  275. buffering.  Here is an example, suppose that we wish to display images
  276. in the following sequence:
  277.  
  278.         15 14 13 12 11 10 9 8 7 8 9 10 11 12 13 14 15 14 13 12 11 etc
  279.  
  280. then we can use the 'x' type of reversible deltas and compute the
  281. following files (it is a good idea to place the dilbm commands in a text
  282. file and use an 'execute' command).
  283.  
  284. dilbm  pic15.image pic14.image dx15-14 x q
  285. dilbm  pic15.image pic13.image dx15-13 x q
  286. dilbm  pic14.image pic12.image dx14-12 x q
  287. dilbm  pic13.image pic11.image dx13-11 x q
  288. dilbm  pic12.image pic10.image dx12-10 x q
  289. dilbm  pic11.image pic9.image  dx11-9  x q
  290. dilbm  pic10.image pic8.image  dx10-8  x q
  291. dilbm  pic9.image pic7.image   dx9-7   x q
  292. dilbm  pic8.image pic8.image   dx8-8   x q
  293. pilbm  buildx.script
  294.  
  295. The file buildx.script contains the following:
  296.  
  297.  
  298. picx.anim
  299. phongm15.image
  300. dx15-14
  301.  
  302. dx15-13
  303. dx14-12
  304. dx13-11
  305. dx12-10
  306. dx11-9
  307. dx10-8
  308. dx9-7
  309. dx8-8
  310. *
  311. 1 2
  312. 2 2
  313. 3 2
  314. 4 2
  315. 5 2
  316. 6 2
  317. 7 2
  318. 8 2
  319. 7 2
  320. 6 2
  321. 5 2
  322. 4 2
  323. 3 2
  324. 2 2
  325. 1 2
  326. 8 2
  327. 1 -1
  328.  
  329.  
  330. Note that the delta file dx8-8 causes no action to take place, so it is
  331. also used in place of dx14-14.
  332.  
  333.  
  334. MOVIE
  335. -----
  336.  
  337. The movie playback program is particularly simple.  Give it the name of
  338. an animation file.  Press the 'escape' key to stop an animation that is
  339. looping.
  340.  
  341. The program may also be run from workbench, set the default tool of the
  342. project (the animation file) to be 'movie'.  Alternatively, hold down
  343. the shift key and click on the project and then while still holding
  344. down the shift key, double click on the movie icon.
  345.  
  346.  
  347. DILBMGEN and PILBMGEN
  348. ---------------------
  349.  
  350. The first one generates a file for executing DILBM.  Call it from CLI
  351. as follows
  352.  
  353.         DILBMGEN >fff 16
  354.  
  355. This will create a file called 'fff' that contains commands for executing
  356. DILBM as needed for a 16 frame animation loop.  The image files are
  357. assumed to be pic0.image, pic1.image, ... pic15.image.  Execute the file
  358. 'fff' as follows:
  359.  
  360.         EXECUTE fff
  361.  
  362. Use PILBMGEN in a similar way.  Call it as follows
  363.  
  364.         PILBMGEN >ggg 16
  365.  
  366. This will create a file called 'ggg' that contains commands for
  367. executing PILBM to assemble a 16 frame animation loop.  Execute
  368. the file from PILBM as follows:
  369.  
  370.         PILBM ggg
  371.  
  372. A file called 'anim' will be created.  Play it as follows
  373.  
  374.         MOVIE anim
  375.  
  376. Good luck!
  377.