EMAIL: philip.chan@home.com
NAME: Philip Chan
TOPIC: Transformation
COPYRIGHT: I SUBMIT TO THE STANDARD RAYTRACING COMPETITION COPYRIGHT.
TITLE: E=mc2
COUNTRY: Canada
RENDERER USED: POV-Ray for Windows version 3.1g
TOOLS USED: MainActor for Windows to create MPEG
            Adobe Photoshop 5.0 Limited Edition to convert "movie poster" to JPEG (no post processing)
CREATION TIME: 33.5 hours of me working at the computer, 46 hours rendering time (detailled breakdown below)
HARDWARE USED: Pentium II 450 MHz, 128 MB RAM
ANIMATION DESCRIPTION:
This animation combines the greatest transformation that modern science believes possible with the transformation
that alchemists attempted to achieve centuries ago.  A lead block is transformed from matter into energy and then
back into matter in the form of a gold block.

DESCRIPTION OF HOW THIS ANIMATION WAS CREATED:

This is the log I kept as I made the animation.  In the spirit of the competition, I have included some of my
knowledge of POV-Ray in the text, which probably will only be useful to other beginners such as myself.  I have
also included my final source files (The 6 animation phases).  The source files contain comments which should
make them easier to read, but some of the comments probably won't make sense to anyone but me.  One final note
on the source files:  there is a seemingly random glitch that can occur when rendering phase 3, 4 or 5.  It is
possible that you may get grey spots on the conveyor belt (a reflection of the wall perhaps?), or it may look
the way it is in my animation.  I have produced both results on my computer without touching the source file
between renders, but if one frame turns out one way, then they all do for that rendering.

April 26, 15:30 to 16:30   -  1 hour

Created the basic shape of the conveyor belt using simple CSG objects and one hexagonal prism.

April 26, 17:30 to 18:15   -  0.75 hours

Added raised sections to the conveyor belt track.  The sections have a length equal to 1/8th the arclength of the 
circular portion of the conveyor belt to make animation of the conveyor belt simpler.  This is because the raised
section will form a complete circle that can just be rotated idefinitely.  Most of the math is done by POV in
while loops.

April 27, 10:15 to 11:15   -  1 hour

Converted the Conveyor_Belt object into an animated macro.  No major difficulties encountered because original
object designed to be animated.

April 27, 13:30 to 14:30   -  1 hour

Added texture to the conveyor belt.  The rubber texture was taken from a previous project.  The wheel uses layered
textures, with a silver texture from textures.inc under a chipped red paint.  The scratches are created with a
spotted colour_map with transparent sections, and scaled so that the spots become more like lines.

April 27, 17:00 to 18:30   -  1.5 hours

Created a nice concrete texture.  Then had serious trouble trying to create a room with good lighting.  Settled for
highly ambient whitewashed walls.

May 08, 14:00 to 15:15  -  1.25 hours

I got frustrated and kinda left the project alone for a week and a half, and then I realized that my lighting
problems were because my monitor was only on 16 bit colour mode so that 3Dfx Glide would work.  I switched to 32
bit colour, rendered the room again, and the lighting looked fine.  I then took my hexagonal prism object and wrote
it into a macro that could create any prism object based on a regular polygon.  I used this macro and created a CSG
object to serve as a more detailed wall section, using the prisms as bolts along the sides of each wall section.

May 10, 15:30 to 16:30  -  1 hour

Resized the wall section object to be a square instead of a rectangle to provide more room for the door (scaling
would have wrecked the bolts) and then built the basic room with the wall sections, and concrete floor/ceiling.  I
then created a CSG object to use (with difference) as the indentation on the door for the door handle.

May 28, 16:00 to 17:00  -  1 hour

I didn't have a chance to work on this project too much since getting my summer job.  Anyway, I created the frame
for the door, and used the CSG object to cut out the spot for the door handle.  I had some problems here, since I
ignored the texturing problems caused by coincident surfaces in the Indentation CSG object (see scene help for more
on coincident surfaces).  I had expected that this would not pose a problem, since I only intended the object to be
used in a difference operation, where it wouldn't have a texture anyways.  As it turned out, I needed to put a
texture on the object, or the surface after the difference operation would be textureless.  Instead of going back
and editing the CSG object, I solved the texture problem by taking the object obtained after the difference
operation and using it in a union with a box which would cover up the affected, but was small enough not to be
usable.

May 28, 18:00 to 19:30  -  1.5 hours

Added the bolts around the edge of the door.  I then created the door handle CSG object, which consists of a
cylinder, a box, and a difference object involving two cylinders and two planes.  This last object creates a curved
tip for the handle, kinda like the front end of a sled.  However, this little bit of detail (which took a good deal
of time to create) will likely not be noticable in the final animation. :(  I also mounted the handle on the door
and applied the same texture I used for the wheel on the conveyor belt.  The door was then added the room.

May 29, 15:00 to 17:00  -  2 hours

Created the "reation chamber" for the transformation machine.  There is quite a bit of trigonometry involved in
this because I measured distances along the arc of the cylinder instead of just along the Y axis.  This mainly
comes into play when placing the bolts, since they must be evenly spaced.  After I worked out how I would do this,
I let POV do the calculations within the while loops I used to place the bolts.  Because of the complexity of the
CSG objects involved, bounding boxes have a significant effect on trace time.  The windows currently use the Glass
texture in textures.inc.  I don't know if I'll stick with this texture yet.

June 07, 14:45 to 16:15  -  1.5 hours

Created the "in box" where the lead block will eventually fall.  This isn't really a complicated CSG object, but one
that took a lot of work because of the number of objects involved.  The bolts were placed with while loops as usual.

June 07, 19:00 to 19:30  -  0.5 hours

Added a base for the chamber as well as the "in box."  The base for the chamber was simple, and the base for the
"in box" required some more trig to place the bolts in a circle.  Once again, all the bolts are placed with while
loops, and the trig is done by POV.
                       
June 08, 11:00 to 12:00  -  1 hour

After some brief experimentation with superquadratic ellipsoid objects, I concluded that I couldn't make the shape
I wanted for the metal blocks with them.  I then attempted to do the same thing with a prism object using a
conic_sweep and quadratic_spline, but I couldn't get the rounded corners to work right.  So, I settled on creating
the illusion of a smooth object by writing a macro which would create a 0.005 unit thick cross section of the shape
I wanted, given the size of the cross section.  The block is then created by a while loop which places 200 cross
sections to create the final object.

June 08, 16:00 to 17:00  -  1 hour

Cut out the labels on the two blocks (Au and Pb).  This took a while since centering the text had to be done by
trial and error.  I also picked some textures out of metals.inc to use on the two blocks.  I'm not sure if I'll
keep them though.
               
June 26, 14:45 to 16:00  -  1.25 hours
                              
Added the connecting tube, which consists of two small untextured cylinders and a glass cylinder which have been
hollowed out.  Started work on the "out box," which is more or less that same as the "in box," except the
dimensions are different, so it is also a lot of work.  I can't just use the "scale" command, since that would
wreck the dimensions of the bolts and raised sections.                                      
                  
June 26, 19:15 to 20:15  -  1 hour

Finished the raises sections and bolts for the "out box," and added the pillar coming down from the ceiling that
holds the box in place.  I used the same methods as in creating the "in box."

July 04, 09:30 to 10:45  -  1.25 hours

Added the mechanisms to lower the gold block and push it onto the conveyor belt.  Again, not much difficults stuff,
just a lot of tedious work.

July 05, 11:00 to 12:00  -  1 hour

Placed the machine into the room, and chose a texture for it from metals.inc.  I also modified the lighting to use
a bank of 8 lights instead of one light in the centre in order to create softer shadows and get rid of the massive
white spot on the machine due the reflection of the light source.

July 05, 15:15 to 17:45  -  2.5 hours

Created a shaft for the conveyor belts in and out of the room.  I then cut holes in the wall for the two conveyor
belts.  At this point, I found out that I had placed the mechanism which pushes the gold block onto the conveyor
belt too low (no room for conveyor because of floor), so I had to raise everything there by 0.50 units.  I also
lengthened the amount of time the conveyor belt could run without losing the raised spots to ensure my animation
wouldn't get screwed up (this probably won't make sense unless you read the source file).  I also had to select a
new texture for the gold block as the one I had picked earlier was two white (probably because it was reflecting
the colour of the walls too much).  Finally, I put the conveyor belts into place.  The room is now completely built.

A few tips for other POV users related what I just did:
1.  Simplify (or remove) complicated textures when your just placing objects to speed up render time.  However,
    NEVER remove textures from large object, such as walls when you are texturing another object that has a
    reflection value.  Reflective textures can look very different in another evironment, even if the reflection
    value is small.
2.  Don't take a union and difference it with something else if you don't have to.  When I tried to take my room
    (union) and cut a hole for the conveyor shaft directly from the entire union object, my PPS dropped below 50!
    When I isolated the wall I was cutting the hole into, did the difference, and used the resulting object in the
    room union, I get over 300 PPS.  Come to think of it, my code prior to this point is probably not very
    efficient...
    
July 10, 14:30 to 15:30  -  1 hour

Attemped to create an animated object which would look like a swirling cloud out of blobs with little success.  The
plan is now just to use an expanding sphere, and then create the illusion of swirling throught the density map of
the interior.    

July 10, 17:00 to 18:30  -  1.5 hours

Using a spherical density map for the interior (media), adding some variable turbulence/rotation (with sinusoidal
waves), I managed to create the effect that I had been trying to get with the blobs.  The energy cloud is also a
light source, with a fading blue light at the centre of the cloud.  The light's fade_distance increases with the
clock.

July 10, 20:15 to 20:45  -  0.5 hours

Prepared animation phase 2 (the energy cloud) for rendering.  Also, a note for POV users:  When working with media,
be aware that an emission media can give exactly the same result as a scattering media and take a lot less time to
render.  Also, when creating a media, turn down the set 'intervals' to a lower number.  I use a value of 10, which
creates a fairly bad quality image, but renders quickly and gives you an idea of what the media looks like.  When I
make the final copy, I use a value of 50, which can slow down rendering a lot, but is much more smooth.

July 11, 22:15 to 23:45  -  1.5 hours

Prepared animation phase 1 (enter lead block) and phase 5 (exit gold block) for rendering.  I had to think of a way
of reversing the direction of my conveyor belts, since I didn't create the macro so you could just enter a negative
angular velocity.  I was about to modify my code when I realized the conveyor belt could be reversed by flipping it
upside down.  For phase 5, which is a multi-stage animation, I didn't use the #if/#else syntax that is suggested in
the POV help file.  Instead, I made creative use of the max(A, B) and (A > B) funtions, and some extra math so that
I could easily keep the objects moving at the same speed.  Basically, max(A, B) is used to assign a maximum value
(stop motion at a certain point).  (A > B) is used to start motion at a certain clock value, but the speed/clock
(in this case, 3*pi) is multiplied by (clock - B) instead of just clock.

July 12, 09:30 to 10:45  -  1.25 hours

I performed the calculations needed for phase 1a (falling lead block) with pencil, paper, and a calculator while my
computer was still rendering away at phase 1.  Anyways, I set an arbitrary downward acceleration and rotation rate
for the first stage of phase 1a to make it easy for me to be sure that the block would clear the edge of the
conveyor belt. I then had to change the rotation rate for the second stage of the animation so that the block would
land upside down on the bottom of the "in box."  (I don't even know if you can actually see this part.)  Like in
phase 5, I made use of the max(A, B) and (A > B) statements rather than using #if/#else to achieve a multi-stage
animation.  As for converting the acceleration into the position of the block, I integrated the acceleration to get
velocity in terms of time, and then integrated the velocity to get position in terms of time.  This wasn't that hard
for me since I just finished a course on this stuff at University in April.

July 12/13, 11:30 to 12:15  -  0.75 hours

I tested the calculations I did earlier in the day and found that because of the rotation, the block still went
through the conveyor belt.  I decided to just modify the my acceleration value, which ends up only affecting three
numbers in the final equations (the clock per second ratio).  Anyway, I found the proper acceleration value through
trial and error.

July 13, 09:00 to 09:15  -  0.25 hours

Prepared phase 4 (Lowering Gold Block) for render.  I also realized that I forgot to make the rotation of the
wheels on phase 1a match phase 1.

July 13, 11:15 to 13:00  -  1.75 hours

I found out that the solution I implemented for the rotation of the wheels didn't actually implement itself as I
left out some brackets when using the z* notation for rotation, so phase 4 need to be rendered again. :( Anyways, I
created the energy beam effect and the lightening effect for use in phase 3. The energy beam is very similar to the
energy cloud.  I just changed the pattern to gradient y, reduced the turbulence and scaled it to fit properly.
Animating it was a little more difficult, because I wanted to show the front of the beam coming in, and the back
leaving the tube.  I couldn't just make the thing and then translate it because it would be too big too long to fit
inside the machine, and I didn't want to stop it in the middle because the motion is what gives the beam a pulsing
effect.  The solution I came up with was to put a clipping box so that anything you shouldn't be able to see was
cut off, and then translating the sphere capped cylinder through the clipping box.  The CSG object actually starts
completely outside its clipping_box.  The lightening effect uses a modified version of the Lightening1 texture that
comes with POV.  I replaced the marble pattern with gradient y, and changed the colour so that it was blue instead
of purple.  The texture is then applied to a hollow stretched sphere made to fit over the glass connecting tube.

July 13, 13:30 to 5:00  -  1.5 hours

I had to take the two cylinders on the end of the glass connecting tube out of that CSG object because they
interfered with the media.  I don't know why they did that, but making them hollow didn't help either.  However,
when I removed them from the CSG object containing the glass tube, and put them in a separate CSG object, the media
worked fine.  I also tweaked the lightening effect so that it wouldn't interfere with the media effect as much.  I
also added attenuating light sources so that the energy beam gives off a soft blue glow, and the lightening results
in a bright flash of light.  The lightening was animating by selecting three random clock values to occur and three
random duration (the ranges are controlled).  I used my calculator to generate these numbers.  The lightening sphere
and light source are then translated outside of the scene (behind the camera and on the other side of a wall) and
through the use of (clock > A)*(clock < B), they are brought into position between the clock values of A and B.
This was my way of writing an if A and B type statement without having to use #if notation.  I find it easier to do
everything in a mathematical formula then to use compiler directives.

July 14, 17:30 to 18:00  -  0.5 hours


Total Construction Time:  33.5 hours

Phase 1 (Enter Lead Block) Rendering Time:  12 hours, 18 minutes, 24 seconds
Phase 1a (Falling Lead Block) Rendering Time:  6 hours, 49 minutes, 19 seconds
Phase 2 (Energy Cloud) Rendering Time:  14 hours, 23 minutes, 18 seconds
Phase 3 (Energy Beam) Rendering Time:  4 hours, 30 minutes, 10 seconds
Phase 4 (Lowering Gold Block) Rendering Time:  2 hours, 2 minutes, 21 seconds
Phase 5 (Exit Gold Block) Rendering Time:  5 hours, 56 minutes, 48 seconds

Total Rendering Time:  46 hours, 00 minutes, 20 seconds

FINAL THOUGHTS:

In selecting the camera views for my animation sequences, I realized that I had made the machine too big and the
room too small for the whole machine to be seen.  By this time, it was too late for me to resize the room
(remember those bolts that prevent scaling), so I just went with the scene as it was.  Unfortunately, many of the
parts that I spent time on (such as the base for the chamber and "in box" and the beam supporting the "out box" are
not visible anywhere in my final animation.  However, I was pleased at how the camera views I did use showed some
of the finer details that I had put into my animation, such as the scratched paint on the conveyor belt wheels and
the shape of the bolts.  Overall, I think the animation turned out pretty good, considering it is only my second
work.