TITLE: Shell
NAME: Wong Chee Fah
COUNTRY: Malaysia
EMAIL: wongcf@cyberway.com.sg
TOPIC: Physics & Math
COPYRIGHT: I SUBMIT TO THE STANDARD RAYTRACING COMPETITION COPYRIGHT.
JPGFILE: shell01.jpg
ZIPFILE: shell01.zip
RENDERER USED: 
    POV-Ray 3.01 (MSDos)

TOOLS USED: 
    Adobe Photoshop 4 - for image compression

RENDER TIME: 
    9h 0m 10s (32410s)

HARDWARE USED: 
    Pentium 133MHz, 64MB EDO, S3 Virge 4MB EDO

IMAGE DESCRIPTION: 


Visualization of parametric equations defining a shell-shape surface 


DESCRIPTION OF HOW THIS IMAGE WAS CREATED: 


This image is a demonstration of the use of POV-Ray as a visualization tool.
Mathematical functions are better understood if they can be visually presented.
The wealth of mathematical functions available in POV-Ray makes it suitable as
a tool for this purpose.

The parametric equations defining the shell-shape surface are as follows :-

x = U*(cos(V)^2)*cos(U)
y = U*(cos(V)^2)*sin(U)
z = U*cos(V)*sin(V)

The shell is bounded by U from 0 to 4pi and by V from 0 to pi. The grid is
composed of spheres and cylinders unioned together. The grid is created by 
first varying V for ech value of U (using nested While loops) and calculating
the sphere positions. As the spheres are calculated, they are placed in the
union group. The At_Origin and Origin_Occupied identifiers are used to check if
the origin, <0,0,0>, is already occupied by a sphere - this eliminates having
more than one sphere at the origin. As the spheres are placed, cylinders
connecting them are also calculated and placed. Note that checks for U = 0 is
done to prevent instances of degenerate cylinders. Once the first nested While
loop is completed, cross-running cylinders are calculated by varying U for each
value of V using a second set of nest While loops. This time, degenerate
cylinders are prevented by checking for cos(V) = 0. The whole Shell is then
placed in the scene and an onion color map texture is applied.

As a note to those interested in the parameters, the grid can be made smoother
by increasing then number of sphere-cylinder connection that make up each side
of a grid square. This is done by increasing the value of the U_Step and V_Step
parameters. The grid can be made denser (ie. smaller grid squares) by
increasing the Iterations value. Be warned however that memory requirement
increases with an increase in any one of the parameter. This scene for example,
requires 40538290 bytes of memory. Another parameter that controls the grid is
Thickness. As its name implies, it make the grid line thinner or thicker. DO 
NOT enter 0 though as the parameter is used as a divsor.

