/*      A x10 zoom projector showing ray paths in a scattering atmosphere */

#declare Anim            =   no;
#declare AReflmin      = 0.01;   #declare AReflmax    = 1.0;   #declare AReflfal =   7.51;
#declare IsoMaxtrace  =     6;   #declare IsoMaxgrad = 1.0;   #declare Evalac    = 0.001;
#declare GlCrom         =   no;   #declare GlMdya       =  no;   #declare Aspherix =     no;

#include "glasses.inc"

#if ( Anim = 0 )
    #declare klok = 20;
    #declare km2 = klok-2.0;
#else
    #declare klok = 2 + clock*18;
    #declare km2 = klok-2.0;
#end

/*********************************** Setup media and photons ****************************************/

#declare MdyaOn   = yes;   #declare NFtonsOn = yes;
#declare BoxLen   = 270;   #declare BoxHyt = 30;
#declare MdyaThk = 0.1;    #declare MedIntvals = 4; #declare MedSampls = 16; #declare Hfld = no;

global_settings { max_trace_level 16 assumed_gamma 1.0
                        #if(NFtonsOn = yes)
                               photons { count 3e8
                                              max_trace_level 128
                                              #if(MdyaOn = yes) media 200,2 #end
                                              autostop off
                                            }
                        #end
                        #if(Hfld = yes) hf_gray_16 #end
                       }

#if(MdyaOn = yes)
     box { < -0.1,-BoxHyt,-20>,< 0.1,BoxHyt,BoxLen>
              pigment { rgbt 1 } finish { ambient 0 diffuse 0 }
              interior { media { scattering { 1,color rgb 1 extinction 0 } method 3 intervals MedIntvals samples MedSampls } }
              photons { target }
              hollow
            }
#end

#declare RadCyl = degrees(atan2(6.5,1e4));
light_source { -z*1e4 rgb 3e6
                    spotlight radius RadCyl falloff 1.01*RadCyl tightness 10 point_at 0 fade_power 2 fade_distance 10
                    photons { refraction on reflection off }
                    media_interaction on
                  }


/******************************* Projector Lenses ****************************************************/

#declare ThisOrigin = 0.0; #declare NextOrigin = 0.0;

#declare CL3 = 6.67*pow(km2,1.6)*exp(-0.0683*km2)+0.2434; // These are the zoom positions
#declare CL7 = 63.116*km2*exp(-0.2043*km2) -1.1577* km2+4.4423;
#declare CL9 = 401*exp(-0.3085*klok) + 0.0181*klok*klok;
#declare CL9 = 224-CL3-CL7;


// The first lens
#declare LnzNum  = 1; #declare AspR1 = no;    #declare AspR2 = no;
#declare LensBlnk = texture { GlasBlnk }          #declare LensOpen = material { Glas__BAK4 }
#declare R1 = 52.873;   #declare Thk = 2.000; #declare D1 = 8.00;
#declare R2 = 189.829; #declare Nex = CL3;    #declare D2 = 8.00;
#include "lensmp.inc" #declare Lens0203 = object { LensMP translate z*ThisOrigin }


// The second lens
#declare LnzNum   = 2; #declare AspR1 = no;   #declare AspR2 = no;
#declare LensBlnk  = texture { GlasBlnk }         #declare LensOpen = material { Glas__BAK4 }
#declare R1 = 171.458; #declare Thk = 5.000;  #declare D1 = 30.00;
#declare R2 = 83.912; #declare Nex = 8.138;    #declare D2 = 28.00;
#include "lenspp.inc" #declare Lens0405 = object { LensPP translate z*ThisOrigin }

// The third lens
#declare LnzNum = 3; #declare AspR1 = no; #declare AspR2 = no;
#declare LensBlnk = texture { GlasBlnk } #declare LensOpen = material { Glas__BAK4 }
#declare R1 = 132.593; #declare Thk = 12.000; #declare D1 = 30.00;
#declare R2 = 91.913; #declare Nex = CL7 ; #declare D2 = 30.00;
#include "lenspm.inc" #declare Lens0607 = object { LensPM translate z*ThisOrigin }

// The fourth lens
#declare LnzNum = 4; #declare AspR1 = no; #declare AspR2 = no;
#declare LensBlnk = texture { GlasBlnk } #declare LensOpen = material { Glas__BAK4 }
#declare R1 = 136.203; #declare Thk = 6.000; #declare D1 = 28.00;
#declare R2 = 204.774; #declare Nex = CL9; #declare D2 = 28.00;
#include "lenspm.inc" #declare Lens0809 = object { LensPM translate z*ThisOrigin }

// The fifth lens
#declare LnzNum = 5; #declare AspR1 = no; #declare AspR2 = no;
#declare LensBlnk = texture { GlasBlnk } #declare LensOpen = material { Glas__BAK4 }
#declare R1 = 688.808; #declare Thk = 3.000; #declare D1 = 28.00;
#declare R2 = 54.493; #declare Nex = 15.000; #declare D2 = 26.00;
#include "lensmp.inc" #declare Lens1011 = object { LensMP translate z*ThisOrigin }

#declare ZoomProj = intersection { union { object { Lens0203 }
                                                             object { Lens0405 }
                                                             object { Lens0607 }
                                                             object { Lens0809 }
                                                             object { Lens1011 }
                                                           }
                                                  plane { x, 0.15 pigment { rgb<0.5,1,0.5> } finish { ambient 1 } }
                                                  plane { x, -0.15 pigment { rgb<0.5,1,0.5> } finish { ambient 1 } inverse }
                                                 }

object { ZoomProj photons { target refraction on reflection off } }
camera {location x*3e4+z*125 look_at z*125 angle 0.55}

/**************************************************************************************************/

 


     
© Don Barron 2005