TITLE: Chemical Bonding
NAME: David Nash
COUNTRY: Texas, United States
EMAIL: dbn_3@yahoo.com
WEBPAGE: none
TOPIC: Forces of Nature
COPYRIGHT: I SUBMIT TO THE STANDARD RAYTRACING COMPETITION COPYRIGHT.
JPGFILE: chembond.jpg
RENDERER USED: 
    POV-Ray 3.6

TOOLS USED: 
    the Gimp 2.2.7
        - creating the page imagemaps
        - jpeg coversion

RENDER TIME:
      Total Time: 35 hours 4 minutes 15 seconds
        (See image creation notes)
    

HARDWARE USED: 
    Dell Dimension Pentium 4 2.8Ghz; 512MB ram

IMAGE DESCRIPTION:

After a full day of reading the entries on the forces
of molecular bonding in chemistry in the wikipedia, I
needed to get a better image of some of the molecules
I had read about.  One page noted the prefered formula
of octane (a hydrocarbon chain with eight carbon atoms)
used in gasoline is known as 2,2,4-trimethylpentane.

I had a hard time visualizing it, so I printed out some pages
from wikipedia, pulled out my molecular model set and went
to work.  I was suprised at how compact the model was and set
it down on my desk to get a better look at it.

DESCRIPTION OF HOW THIS IMAGE WAS CREATED:

This is my first complete image in POV-Ray.

I have started several times on different images only to
get quickly frustrated at my efforts.  This time I sat still
and worked my way through the documentation.  I say worked
because I tried many test scenes to see how things worked.

I am reasonably happy with CSG modeling and all the models
in this scene are made that way.  I am also reasonably happy
with my attempts at textures, though only a few are layered
and most are just from the included files like woods.inc.

I am still uncomfortable with lighting.  There are only two
lights in the scene -- an area light close to the back wall
and a spotlight on the octane model.  It works well in this
simple scene, though I still need to look at many more images
and .pov files on the newsgroups to get a better idea for
larger images.

The pages are actually screenshots from wikipedia --
http://en.wikipedia.org -- and then stitched together with
fake printer headers and footers using the Gimp.  Note the
wikipedia is released under the GNU Free Documentation License
so there is no copyright problem.  Both the gimp files and
png files used in the final image_maps are included in the
zip file.

The molecular model include file has the math I used to figure
out the bond angles.  I tried to make the code as generic as
possible so I can make a macro out of it some day, but I really
only have a grasp of trigonometry to calculate angles and
lengths using sine, cosine, tangent, and their inverses.

One thing I discovered in the middle of making that include file
was that I didn't have to continue placing each atom and bond
individually.  I could make subgroups and place them instead.
That's why, when you look at the definition of octane, there
are lots of individual placing of atoms and bonds at the
beginning, then placing of whole methane groups at the end.

I used randomness in some places in the scene.  The holes in
the board on the wall and the pushpins are randomly placed.
One improvement I could make would be to somehow keep track
of where things are placed and then make sure the next things
placed are not too close to a previous thing.  I have some
idea how to do that, but I think I will look for some examples
before I start.  The loose atoms and bonds are specifically
placed, but randomly rotated.  I specifically placed them
because being that close to the viewer, it is obvious quickly
if there is an overlap.

The pages are just clipped planes.  A better method would be
some kind of mesh to make them not so flat -- maybe a bent-up
edge or two.

On the final run, I turned on the radiosity and found pie
shaped shadow artifacts under the holes in the board.
I had to turn dowh the error_bound until they went away
(and then ramp up the rays to compensate). That really shot
up the render time and washed out the shadows under the
pushpins, but it looks much warmer.  I'm sure I really
overdid it, because the time was more than 14 times longer
than without radiosity.

I enjoyed this and hope to continue in the future (as time
permits). 

STATISTICS

Render Statistics
Image Resolution 1024 x 768

Pixels:           797041   Samples:        44126249   Smpls/Pxl: 55.36
Rays:          374928488   Saved:          11740443   Max Level: 8/32

Ray->Shape Intersection          Tests       Succeeded  Percentage

Box                          268846916        84571825     31.46
Cone/Cylinder              22769403194       214617165      0.94
CSG Intersection             606304343       107369093     17.71
CSG Merge                    648653529       152106505     23.45
CSG Union                   4765166845       225010532      4.72
Plane                       4652668662      1428578554     30.70
Prism                        224592142        56010198     24.94
Prism Bound                  976110352       675128082     69.17
Sphere                     23331967911       296104305      1.27
Superellipsoid                30993449          752874      2.43
Torus                        419088069        29455736      7.03
Torus Bound                  419088069        36963569      8.82
True Type Font              6424744844         8008557      0.12
Clipping Object              305677574       115077240     37.65
Bounding Box               17180157342      6975898518     40.60

Function VM calls:                2

Roots tested:              43734322   eliminated:             16405526
Calls to Noise:           570770194   Calls to DNoise:      1078138170

Shadow Ray Tests:        1865426197   Succeeded:             266329566
Reflected Rays:            72036394
Transmitted Rays:          15582845

Radiosity samples calculated:           388204 (0.15 %)
Radiosity samples reused:            266025012

Smallest Alloc:                  18 bytes
Largest  Alloc:               90016 bytes
Peak memory used:          76624576 bytes
Total Scene Processing Times
  Parse Time:    0 hours  0 minutes  0 seconds (0 seconds)
  Photon Time:   0 hours  0 minutes  0 seconds (0 seconds)
  Render Time:  35 hours  4 minutes 15 seconds (126255 seconds)
  Total Time:   35 hours  4 minutes 15 seconds (126255 seconds)
CPU time used: kernel 11.05 seconds, user 123270.69 seconds, total 123281.73 seconds
Render averaged 6.38 PPS over 786432 pixels

POV-Ray finished

