TITLE: Perspectives
NAME: John Guthkelch (Doctor John)
COUNTRY: U.K.
EMAIL: jguthkelch@netscape.net
TOPIC: Frozen Moment
COPYRIGHT: I SUBMIT TO THE STANDARD RAYTRACING COMPETITION COPYRIGHT.
JPGFILE: jgperspe.jpg
ZIPFILE: jgperspe.zip
RENDERER USED: 
    Povray 3.5
TOOLS USED: 
    gvim, The Gimp, F. Dispot's gearmess program and imagination
RENDER TIME: 
    10 hours 0 minutes 9.0 seconds
HARDWARE USED: 
    Home-brewed P-166 with 32 meg RAM and two clunky ST3660A (520
meg) HDDs! I'm still also using my seven-year-old 15" monitor - gamma in the
range of 3.5 - 3.7 (or thereabouts)
IMAGE DESCRIPTION: 
    thinks Frozen Moment? Frozen Moment?? A snapshot of a
moment in time? A frozen moment of fear? A cold and windswept landscape? 
*goes for beer and chat with friends*  A moment in time? It 
depends on your viewpoint; your perspective, if you like. Are you looking 
from a human viewpoint, an atomic viewpoint, planetary, stellar...? 
*return from beer* *start coding*
As stated above, it depends on your perspective. So I've brought together 
four different timescales. Stellar, Planetary, Human (the clockworks) and 
Atomic (an idealised atomic lattice).
Note the artistic joke - using a field camera to distort perspectives :-)
DESCRIPTION OF HOW THIS IMAGE WAS CREATED: 
    The starfield and the M-type
planet are basic POVRay constructs. No trickery involved, tho' it's probably 
worth noting that I raised the cloud sphere above the planet sphere to give
a better impression of dimensionality.
The clockworks lean heavily on Marc Schimmler's gear-wrapper macros and F. 
Dispot's gearmess algorithm. Without both of these, I would still be trying
to work out the complex spatial maths to produce a gearset that at least 
looks like it has a fighting chance of working. Many thanks to both of them.
The atomic lattice is again a basic POVRay construct, an infinity box 
produced by making a box with zero colour and total transmission with an 
interior texture of an almost perfect mirror. The only problem I had with 
this was in adjusting the verticals, which led me to produce my FieldCam 
macro. This is at the bottom of this file if you don't want to have to unzip
my source code.
The story of the final render deserves a separate chapter all to itself. Put 
it this way: It's 02:55 on 31-12-2002, it's raining, I'm on line 63 of 900 
for the sixth time and I've got a full mug of coffee. Hit it, Jake!
Full code (apart from my starfield.inc) is in jgperspe.zip - jgperspe.pov 
has Unix line-ends, jgperspedos.pov has DOS line-ends.
****************************************************************************
Statistics for jgperspe.pov, Resolution 1200 x 900
----------------------------------------------------------------------------
Pixels:         1081200   Samples:         2602272   Smpls/Pxl: 2.41
Rays:           6191687   Saved:                 0   Max Level: 15/15
----------------------------------------------------------------------------
Ray->Shape Intersection          Tests       Succeeded  Percentage
----------------------------------------------------------------------------
Box                          225876615        26160777     11.58
Cone/Cylinder                696554616       343287442     49.28
CSG Intersection             231386368        22349261      9.66
CSG Merge                    118379550        26730398     22.58
CSG Union                    191400570        14287725      7.46
Plane                        526875542       373157404     70.82
Prism                          5294181         4685875     88.51
Prism Bound                  132354525        93606878     70.72
Sphere                        27178738        12035580     44.28
Torus                         80345652         3349548      4.17
Torus Bound                   80345652         4170318      5.19
Triangle                         28064           12613     44.94
Bounding Object              290635681        37532612     12.91
Bounding Box                1712664895       551319679     32.19
----------------------------------------------------------------------------
Roots tested:              8393915   eliminated:              475466
Calls to Noise:            5336877   Calls to DNoise:       34494863
----------------------------------------------------------------------------
Shadow Ray Tests:         84544162   Succeeded:              9180925
Reflected Rays:            2798354
Transmitted Rays:           791061
----------------------------------------------------------------------------
Smallest Alloc:                 10 bytes   Largest:            24028
Peak memory used:          3957194 bytes
----------------------------------------------------------------------------
Time For Parse:    0 hours  0 minutes   6.0 seconds (6 seconds)
Time For Trace:   11 hours  0 minutes  58.0 seconds (39657 seconds)
    Total Time:   11 hours  1 minutes   3.0 seconds (39663 seconds)
    
****************************************************************************
// A macro that simulates a true architectural field camera. No longer do you
// have to ensure that the camera location/look_at vector is parallel to the 
// XY or YZ planes before shearing the camera to get parallel verticals.
// Don't forget to switch off Vista Buffers using -uv on the command line 
// before attempting to render your image.
#macro FieldCam (CP, CL)
        #local CD=CL-CP;
        #local HypoXZ=sqrt(pow(CD.x, 2)+pow(CD.z, 2));
        #local CosThetaX=CD.x/HypoXZ;
        #local CosThetaZ=CD.z/HypoXZ;
        #if (CD.x=0)
         #local ShearX=0;
        #else
         #local ShearX=(CD.y/CD.x)*pow(CosThetaX, 2);
        #end
        #if (CD.z=0)
         #local ShearZ=0;
        #else
         #local ShearZ=(CD.y/CD.z)*pow(CosThetaZ, 2);
        #end
        #declare NoFall=transform {
         matrix <1, 0, 0, ShearX, 1, ShearZ, 0, 0, 1, 0, 0, 0>
        }
#end
#declare CamPos=;   //Just replace  with location vector
#declare CamLook=;  // -"-   -"-    with look_at vector
camera {
        FieldCam (CamPos, CamLook)
        perspective
        location CamPos
        transform { NoFall }
        angle whatever    //Don't forget to specify the angle :-)
        look_at CamLook    
}