home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / mags / spectrum / spectrum2 / !Spectrum2 / Articles / Regulars / HDTDT < prev    next >
Encoding:
Text File  |  1994-09-17  |  4.4 KB  |  93 lines

  1. {fon:homAAFF1D}
  2. How do they do that?
  3. {fon:tri}
  4.  
  5. Mike Williams of Sounds Riscy created a ray traced animation of a
  6. set of headphones spinning round, with the words SOUNDS RISCY in
  7. front of them. How did he do that?
  8.  
  9. First of all, he created a sprite for the words "SOUNDS RISCY". This 
  10. was done by creating a TEXT object in !Draw containing those words. 
  11. A suitable outline font was chosen, in this case the PD font 
  12. SWZ.BLACK. Then the text was converted to an outline and the
  13. outline was given a different colour and a thick line width. The
  14. drawing was then converted to a sprite by grabbing part of the
  15. screen with the snapshot facility in !Paint. Because the sprite 
  16. was intended to end up as the full width of a mode 13 screen it was
  17. captured in a higher resolution mode (actually mode 40) and
  18. converted to mode 13 late. If it had been captured in mode 13, the
  19. maximum size would have been reduced by the width of the scroll
  20. bars of the !Draw window.
  21.  
  22. Then the clouds INSIDE the letters were created. The clouds were
  23. created using POVRay, an excellent PD raytracer. The clouds use the
  24. standard POVRay texture called Bright_Blue_Sky, with the lighting
  25. set to "ambient 1". The POVRay output was created as a CLEAR file
  26. and converted to a mode 13 sprite using the Shareware Translatr
  27. program. The sprite with the letters was then given a mask, and the
  28. INSIDE of the letters was made transparent. Using Paint in a high
  29. resolution mode (so I could see right to the edge at 100% scaling),
  30. I then performed a brush-with-sprite operation using the letters
  31. as a brush (remembering to switch the "shape" facility off. This 
  32. resulted in a sprite containing a white background, black edges,
  33. and in the insides of the letters the clouds showing through. This
  34. was then trimmed; using adjust size for the top and right edges,
  35. then flipping the sprite over and using adjust size to trim the
  36. other two edges. Finally the outside of the letters was made
  37. transparent.
  38.  
  39. Then the headphones and background were constructed in POVRay. The
  40. cans are made of half-ellipsoids. The headband is made by cutting
  41. one cylinder out from the centre of another one, then cutting the
  42. resulting ring in half. The cuffs at the edge of the cans are
  43. elliptical torusses.
  44.  
  45. Working out the equation for an elliptical torus is tricky, how do
  46. they do that? The answer is that they don't work out the equation.
  47. The PD program POVShape (by Mike Williams) was used to calculate
  48. the equation of a torus with a suitable major and minor radius,
  49. and the resulting circular torus was later stretched in the Y
  50. direction using a scale command.
  51.  
  52. After checking that the POVRay image looked OK, the source file was
  53. split into two parts. One containing the background and one
  54. containing the headphones against a plain background. If this
  55. isn't done, then when the image is converted to a sprite, the
  56. error correction on the background is slightly different on each
  57. frame, and the colours will ripple disconcertingly when it is
  58. animated.
  59.  
  60. Because the headphones are symmetrical, they look exactly the same
  61. after a rotation of 180 degrees, therefore it was not necessary
  62. to rotate them through 360 degrees. 18 versions of the headphone
  63. source file were prepared, varying only by the angle of rotation of
  64. the headphones. Then they were all raytraced with POVRay. They
  65. were all created as CLEAR files and converted to sprites using
  66. Translatr, because it's got a better algorithm than the one built
  67. into POVRay. Then the sprites were given transparency masks, and
  68. the background made transparent.
  69.  
  70. Then a small BASIC program was written which loads the background,
  71. plots the headphones on top of the background, plots the words on
  72. to of that, then sages the resulting sprite.
  73.  
  74. The individual frames were then animated using the Delta Animator
  75. part of Render Bender I. (I would have used SPLICE if I had it).
  76. Delta Animator accepts input from files of type RenPic, so the
  77. sprites were converted to this format first using the screen
  78. compressor supplied with Render Bender I.
  79.  
  80. The Delta Animator produced the file "HEAD" which contains all the 
  81. differences between the frames of the animation. To perform an
  82. animation you need an original frame as well as the changes. This
  83. was converted back from RenPic to sprite format because the
  84. decompressor is not PD, and cannot be given away as part of the
  85. final animation.
  86.  
  87. Finally a little BASIC program was written to display the results.
  88.  
  89. So now you know.
  90.  
  91. {spr:l03}
  92. {end}
  93.