{fon:homAAFF1D}
How do they do that?
{fon:tri}

Mike Williams of Sounds Riscy created a ray traced animation of a
set of headphones spinning round, with the words SOUNDS RISCY in
front of them. How did he do that?

First of all, he created a sprite for the words "SOUNDS RISCY". This 
was done by creating a TEXT object in !Draw containing those words. 
A suitable outline font was chosen, in this case the PD font 
SWZ.BLACK. Then the text was converted to an outline and the
outline was given a different colour and a thick line width. The
drawing was then converted to a sprite by grabbing part of the
screen with the snapshot facility in !Paint. Because the sprite 
was intended to end up as the full width of a mode 13 screen it was
captured in a higher resolution mode (actually mode 40) and
converted to mode 13 late. If it had been captured in mode 13, the
maximum size would have been reduced by the width of the scroll
bars of the !Draw window.

Then the clouds INSIDE the letters were created. The clouds were
created using POVRay, an excellent PD raytracer. The clouds use the
standard POVRay texture called Bright_Blue_Sky, with the lighting
set to "ambient 1". The POVRay output was created as a CLEAR file
and converted to a mode 13 sprite using the Shareware Translatr
program. The sprite with the letters was then given a mask, and the
INSIDE of the letters was made transparent. Using Paint in a high
resolution mode (so I could see right to the edge at 100% scaling),
I then performed a brush-with-sprite operation using the letters
as a brush (remembering to switch the "shape" facility off. This 
resulted in a sprite containing a white background, black edges,
and in the insides of the letters the clouds showing through. This
was then trimmed; using adjust size for the top and right edges,
then flipping the sprite over and using adjust size to trim the
other two edges. Finally the outside of the letters was made
transparent.

Then the headphones and background were constructed in POVRay. The
cans are made of half-ellipsoids. The headband is made by cutting
one cylinder out from the centre of another one, then cutting the
resulting ring in half. The cuffs at the edge of the cans are
elliptical torusses.

Working out the equation for an elliptical torus is tricky, how do
they do that? The answer is that they don't work out the equation.
The PD program POVShape (by Mike Williams) was used to calculate
the equation of a torus with a suitable major and minor radius,
and the resulting circular torus was later stretched in the Y
direction using a scale command.

After checking that the POVRay image looked OK, the source file was
split into two parts. One containing the background and one
containing the headphones against a plain background. If this
isn't done, then when the image is converted to a sprite, the
error correction on the background is slightly different on each
frame, and the colours will ripple disconcertingly when it is
animated.

Because the headphones are symmetrical, they look exactly the same
after a rotation of 180 degrees, therefore it was not necessary
to rotate them through 360 degrees. 18 versions of the headphone
source file were prepared, varying only by the angle of rotation of
the headphones. Then they were all raytraced with POVRay. They
were all created as CLEAR files and converted to sprites using
Translatr, because it's got a better algorithm than the one built
into POVRay. Then the sprites were given transparency masks, and
the background made transparent.

Then a small BASIC program was written which loads the background,
plots the headphones on top of the background, plots the words on
to of that, then sages the resulting sprite.

The individual frames were then animated using the Delta Animator
part of Render Bender I. (I would have used SPLICE if I had it).
Delta Animator accepts input from files of type RenPic, so the
sprites were converted to this format first using the screen
compressor supplied with Render Bender I.

The Delta Animator produced the file "HEAD" which contains all the 
differences between the frames of the animation. To perform an
animation you need an original frame as well as the changes. This
was converted back from RenPic to sprite format because the
decompressor is not PD, and cannot be given away as part of the
final animation.

Finally a little BASIC program was written to display the results.

So now you know.

{spr:l03}
{end}
