home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 216 / 216.d81 / t.megamorph < prev    next >
Text File  |  2022-08-26  |  8KB  |  298 lines

  1. u
  2.             Megamorph 2002
  3.  
  4.    Program and Text by Ray Parrish
  5.  
  6.  Those of you who saw H.A.M.S. on
  7. issue #159 may remember the demo
  8. animation of one dinosaur morphing
  9. into another. I created the frames for
  10. that animation using an old program
  11. from Compute's Gazette called
  12. "Megamorphs." The program did its job,
  13. but I felt it needed a considerable
  14. amount of work to bring it up to more
  15. modern standards. I'll get into those
  16. changes later.
  17.  
  18.  For those who did not see the demo,
  19. this program creates a sequence of
  20. slides between a start image and an
  21. end image. (Both are just plain
  22. bitmaps.) The result won't quite look
  23. like a Hollywood-style morph, but
  24. rather impressive anyway. The more
  25. expensive morphs track shapes in the
  26. images. This program simply moves each
  27. pixel in the start frame toward its
  28. new position in the end frame along a
  29. calculated path.
  30.  
  31.  
  32.  [Main Menu]
  33.  [---------]
  34.  
  35.  From this screen you can view and
  36. change all of the parameters for the
  37. morph. The menu items can be selected
  38. either by scrolling to them or hitting
  39. the corresponding number key. Other
  40. hotkeys in the lower half of the menu
  41. are highlighted.
  42.  
  43.  [1. Create Pixel Data & Morph]
  44.  
  45.  This menu item is the heart of the
  46. program. Before executing, it checks
  47. to make sure you have selected start
  48. and end images for your sequence.
  49. Before selecting, double-check your
  50. drive selections, image rows, and
  51. slide number/offset. [NOTE:] Be sure
  52. to remove existing slides and/or pixel
  53. data files (called 'startpoints' and
  54. 'stoppoints') from the appropriate
  55. disks to avoid errors. You may change
  56. the Offset to add slides to a sequence
  57. you already have on your destination
  58. disk.
  59.  
  60.  Once the process begins, the start
  61. and end images will be loaded into
  62. memory and mapped to disk. This is
  63. done by going row by row, checking for
  64. 'on' pixels. The number of rows
  65. scanned in each image is determined by
  66. the Rows parameters on the main
  67. screen. (Remember that each screen row
  68. is 8 pixel rows.) The border is blue
  69. while loading the images and red while
  70. mapping to disk.
  71.  
  72.  After the images have been mapped to
  73. disk, Megamorph must 'equalize' the
  74. number of 'on' points in the start
  75. image versus the number in the end
  76. image. Keep this in mind when choosing
  77. your images. If there is a large
  78. difference in the number of points,
  79. the morph sequence will not look as
  80. good. Border color during equalization
  81. is yellow.
  82.  
  83.  Now each frame can be rendered (green
  84. border). Pixel coordinates are read in
  85. from the startpoints and stoppoints
  86. files, then run through an algorithm
  87. to determine their new location along
  88. the path. After each frame is
  89. rendered, the border turns light blue
  90. while saving it to the destination
  91. disk.
  92.  
  93.  When the morphing process has
  94. completed, the border will flash and a
  95. bell will sound to alert you (or wake
  96. you up if you fell asleep while it was
  97. running). Press any key to return to
  98. the main menu.
  99.  
  100.  [2. Morph from Existing Data]
  101.  
  102.  This option works the same way as the
  103. first menu item, but it skips the
  104. image-mapping process. It uses the
  105. start/stoppoints files created from a
  106. previous morphing run to render the
  107. frames.
  108.  
  109.  After Megamorph reads through the
  110. files to determine the number of
  111. pixels used, it displays this number
  112. in the status bar. Press any key to
  113. continue from there. If no such files
  114. exist on your Pixel Data drive, you
  115. will be so informed on the status bar
  116. to try again.
  117.  
  118.  [3. Choose Image Files]
  119.  
  120.  Here you are presented with a file
  121. requestor showing the contents of your
  122. source drive. The files you select
  123. must be plain bitmaps, which are
  124. usually 32 blocks or less. If your
  125. images use another format, see the
  126. short image conversion section further
  127. down. [Choose your images wisely!]
  128. Pictures that are very 'busy' or
  129. heavily-dithered will not generate
  130. nice morphs.
  131.  
  132.  [4. Drive Setup]
  133.  
  134.  Choose your Source, Destination, and
  135. Pixel Data drives here. Megamorph
  136. supports drives 8-16, and be sure not
  137. to choose drive 14 if you have a SG
  138. Gold printer interface. In the drive
  139. selection menu, the right digit of
  140. each drive number is a hotkey. '8' for
  141. 8, '0' for 10, and so on.
  142.  
  143.  [5. Send Disk Command]
  144.  
  145.  Choose your drive and enter the
  146. command string. The status of the
  147. error channel is shown in the status
  148. bar. Due to restrictions on text
  149. input, the ?, <, >, and other
  150. characters cannot be entered. Hit
  151. RETURN without entering anything to
  152. abort.
  153.  
  154.  [6. View Disk Directory]
  155.  
  156.  Choose your drive, then use CRSR/
  157. RETURN to scroll/exit.
  158.  
  159.  [7. View Bitmap]
  160.  
  161.  Choose your drive, then select your
  162. image in the file requestor. (The same
  163. guidelines as those for morph image
  164. selection apply.) Then enter the
  165. number of rows you wish to view.
  166.  
  167.  This routine uses a manual read of
  168. the image so that you can just view
  169. the specified number of rows. However,
  170. if you select the full 25 screen rows,
  171. the image is simply loaded into memory
  172. using whatever fastloader you may have
  173. installed. This routine is useful for
  174. determining how many rows of each
  175. image you should use.
  176.  
  177.  [8. Help]
  178.  
  179.  View the built-in help summary.
  180.  
  181.  [9. Quit]
  182.  
  183.  Quit to Loadstar if it is in one of
  184. your drives.
  185.  
  186.  [Additional Hotkeys]
  187.  
  188.  B - change the number of screen rows
  189. to use in the first image.
  190.  
  191.  E - change the number of screen rows
  192. to use in the end image.
  193.  
  194.  S - change the number of slides in
  195. the morph sequence. The default value
  196. of 2 will just recreate the first and
  197. last image, so I recommend using a
  198. higher number.
  199.  
  200.  O - change the offset for numbering
  201. the slides. This lets you add new
  202. sequence to an existing set of
  203. slides.
  204.  
  205.  [Picture Conversion]
  206.  [------------------]
  207.  
  208.  Megamorph expects your source images
  209. to be bitmaps, but sometims the pics
  210. you want to use are not in the proper
  211. format.
  212.  
  213.  To convert a DOODLE file, try this:
  214.  
  215.  load"doodle file",dv,1   [RETURN]
  216.  
  217.  
  218.  sys57812"bit map",dv:poke193,0:poke
  219.   194,96:poke174,165;poke175,127:
  220.   sys62954   [RETURN]
  221.  
  222.  For OCP Art Studio files (not
  223. Advanced) use this:
  224.  
  225.  load"ocp file     pic",dv,1
  226. [RETURN]
  227.  
  228.  
  229.  sys57812"bit map",dv:poke193,0:poke
  230.   194,32:poke174,165:poke175,63:
  231.   sys62954   [RETURN]
  232.  
  233.  You could also use other various
  234. programs to convert your pictures to
  235. hi-res bitmaps.
  236.  
  237.  [Recommendations]
  238.  [---------------]
  239.  
  240.  With this program, the more system
  241. power you have, the better. It [can]
  242. be run on a stock C64 with one 1541,
  243. but there isn't enough space left for
  244. a large morph sequence, and it will
  245. take a very long time to run. If you
  246. have more than one drive, you should
  247. use your fastest drive to store the
  248. pixel data.
  249.  
  250.  If you have a SuperCPU, you will see
  251. a slight performance increase over
  252. just using JiffyDOS. If you also have
  253. at least 1 meg of SuperRAM installed,
  254. then I suggest you use Ultramorph
  255. (coming soon!) which stores the pixel
  256. data in the SuperRAM for a huge speed
  257. increase.
  258.  
  259.  [Program Notes]
  260.  [-------------]
  261.  
  262.  Bringing this old program up to more
  263. modern standards took some work. In
  264. addition to giving it a nicer menu
  265. with a few added features, I also
  266. cleaned up the BASIC code and modified
  267. its data format to be easier to manage
  268. and friendlier to drives with smaller
  269. capacities.
  270.  
  271.  Originally, Megamorphs stored the
  272. coordinates of each 'on' point by
  273. PRINT#ing the x-coordinate and y-
  274. coordinate to disk. I changed the
  275. format to store the x-coordinate in
  276. high-byte, low-byte format, followed
  277. by the y-coordinate in byte form. This
  278. cut down the size of the data files
  279. considerably.
  280.  
  281.  Megamorphs also used the bitmap at
  282. $2000 without altering BASIC pointers
  283. to protect that space. When I decided
  284. to add modules like Menu Toolbox III,
  285. I had to choose a new location, $6000
  286. in VIC bank 1.
  287.  
  288.  To pack Megamorph into one file, Star
  289. Linker wasn't totally cooperative. So
  290. I just linked the font ML (thanks to
  291. Font Compiler) to the BASIC code. Then
  292. I used SledgeHammer to add the other
  293. ML modules, finally packing it with
  294. Datel's SuperCrunch.
  295.  
  296.  RP
  297.  
  298.  
  299.