// Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3.5 // Desc: Basic Scene Example // Date: mm/dd/yy // Auth: ? // #version 3.5; #include "colors.inc" #include "rand.inc" global_settings { assumed_gamma 1.0 ambient_light rgb <1,1,1> } // ---------------------------------------- // create a regular point light source light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color translate <-20, 40, -20> } camera { location 12*<0.0, 0,-6.50> direction 1.5*z right x*image_width/image_height look_at <0.0, 0.0, 0.0> } #declare lclock=clock+.8; #declare linterpolater=function(xx,xa,xb,a,b){ (xx-xa)*(b-a)/(xb-xa)+a } //building an approximate nucleus from a simple cubic array of nucleons #declare n_size=.8; //"size" of nucleons ->sets scale in image #declare nucleon=sphere{0, n_size*.6 }; #declare A=184; //Atomic mass number #declare Z=74; //Atomic number #declare frac=Z/A; #declare n_rad=pow(3*A/(4*pi),.33333)*n_size; //radius of nucleus #declare Rn=n_rad; //outer nuclear shell #declare ncloud=1.5*n_rad; sphere{ 0,ncloud texture {pigment {color rgbf <1,1,1,1>}} hollow interior { media { emission color rgbt <.7,.0,.0,.3> scattering {5} intervals 2 samples 32 method 3 // aa_threshold 0.3 aa_level 5 density {spherical scale ncloud} } } } #declare Nsh = int(pi*n_rad/n_size); #declare i=0; #declare sr=-.62321; union{ #while(i<=Nsh) #declare qi=(i/Nsh*pi); #declare Ri=n_rad*sin(qi); #declare Ni=max(1,int(2*pi*Ri/n_size)); #declare yi=n_rad*cos(qi); #declare j=1; #while(j<=Ni) object{nucleon translate yi*y+Ri*z rotate y*j*360/Ni #declare sr=SRand(sr); #if(abs(sr) } finish{ambient .40 diffuse .50}} #else texture {pigment { color rgbt <.2,.2,.2,0> } finish{ambient .40 diffuse .50}} #end } #declare j=j+1; #end #declare i=i+1; #end rotate x*90 } //one in nuclear shell union{ #declare n_rad=n_rad-n_size; //radius of nuclear shell #declare Nsh = int(pi*n_rad/n_size); #declare i=0; #while(i<=Nsh) #declare qi=(i/Nsh*pi); #declare Ri=n_rad*sin(qi); #declare Ni=max(1,int(2*pi*Ri/n_size)); #declare yi=n_rad*cos(qi); #declare j=1; #while(j<=Ni) object{nucleon translate yi*y+Ri*z rotate y*j*360/Ni #declare sr=SRand(sr); #if(abs(sr) } finish{ambient .40 diffuse .50}} #else texture {pigment { color rgbt <.2,.2,.2,0> } finish{ambient .40 diffuse .50}} #end } #declare j=j+1; #end #declare i=i+1; #end rotate x*90} //electron orbits and occupancy #declare res = array[7]; #declare nes = array[7]; #declare enorb = 1.2*Rn; #declare res[1]= 2*enorb; //K shell #declare nes[1]= 2; #declare res[2]= 3*enorb; //L shell #declare nes[2]= 8; #declare res[3]= 4*enorb; //M shell #declare nes[3]= 18; #declare res[4]= 5*enorb; //N shell #declare nes[4]= 32; #declare res[5]= 6*enorb; //O shell #declare nes[5]= 12; #declare res[6]= 7*enorb; //P shell #declare nes[6]= 2; #declare e_size = n_size*.75; #declare electron=sphere{0, e_size texture {pigment { color rgbt <.2,.2,.9,0> } finish{ambient .80 diffuse .50}}}; #declare ecloud=res[6]; //skip two electrons //target #declare i_target=1; //which shell #declare n_target=1; //which electron #declare y_target=res[i_target]*cos((n_target-1)/nes[n_target]*2*pi); #declare x_target=res[i_target]*sin((n_target-1)/nes[n_target]*2*pi); //transitioning electron #declare i_trans =3; //which shell #declare n_trans=18; //which electron #declare x_trans=res[i_trans]*sin((n_trans-1)/nes[i_trans]*2*pi); #declare y_trans=res[i_trans]*cos((n_trans-1)/nes[i_trans]*2*pi); //projectile electron #declare pexstart= -ecloud*3; #declare peystart= y_target/2; #declare t_to_c =.20; //time to collision #declare vpx= (x_target-pexstart)/t_to_c; #declare vpy= (y_target-peystart)/t_to_c; #declare vpfx=.5*vpx; #declare vpfy=.8*vpy; #declare vtfx=.6*vpfx; //target final velocity #declare vtfy=-.8*vpfy; //transition #declare t_to_t = .6; //time to start transition #declare t_to_tf= .8; //time for end of transition //photon #declare photon_wave=function(x) { (.5 - atan(25*x)/(pi))*cos(5*x) + (.5 + atan(25*x)/(pi))* exp(-15*abs(x*x)) } #declare wstart=-2.5*pi; #declare wend =.75; #declare wthick=.15; #declare wnseg=250; #declare wxnew=wstart; #declare wynew=photon_wave(wxnew); #declare wdx=(wend-wstart)/wnseg; #declare phsize=enorb*.3; //emission point #declare emx=.5*(x_trans+x_target); #declare emy=.5*(y_trans+y_target); //photon location #declare px=emx+(lclock-t_to_t)*ecloud/(t_to_tf-t_to_t)/2-enorb; #declare py=emy; difference{ //"unmask" photon union{ #while (wxnew <=wend) #declare wxold=wxnew; #declare wyold=wynew; #declare wxnew=wxold+wdx; #declare wynew=photon_wave(wxnew); cylinder{ wxold*x+wyold*y,wxnew*x+wynew*y,wthick } #end cone{wxnew*x,8*wthick,(wxnew+.75)*x,0 scale <1,1,wthick>} texture {pigment { color rgbt <1,1,0,0> } finish{ambient 1 diffuse 1}} scale phsize*<1,1,1> translate -enorb*z translate px*x+py*y } cylinder{(emx)*x+emy*y-enorb*z,(emx-1000)*x+emy*y-enorb*z, enorb} } #switch (lclock) #range (0,t_to_c) // projectile incoming #declare xp= pexstart+vpx*lclock; #declare yp= peystart+vpy*lclock; #declare xtarg=x_target; #declare ytarg=y_target; #declare xtrans=x_trans; #declare ytrans=y_trans; #break #range (t_to_c,t_to_t) // post collision, pre transition #declare xp= x_target+vpfx*(lclock-t_to_c); #declare yp= y_target+vpfy*(lclock-t_to_c); #declare xtarg= x_target+vtfx*(lclock-t_to_c); #declare ytarg= y_target+vtfy*(lclock-t_to_c); #declare xtrans=x_trans; #declare ytrans=y_trans; #break #range (t_to_t,t_to_tf) // transition #declare xp= x_target+vpfx*(lclock-t_to_c); #declare yp= y_target+vpfy*(lclock-t_to_c); #declare xtarg= x_target+vtfx*(lclock-t_to_c); #declare ytarg= y_target+vtfy*(lclock-t_to_c); #declare xtrans=linterpolater(lclock,t_to_t,t_to_tf,x_trans,x_target); #declare ytrans=linterpolater(lclock,t_to_t,t_to_tf,y_trans,y_target); #break #else // post transition #range (t_to_t,t_to_tf) // transition #declare xp= x_target+vpfx*(lclock-t_to_c); #declare yp= y_target+vpfy*(lclock-t_to_c); #declare xtarg= x_target+vtfx*(lclock-t_to_c); #declare ytarg= y_target+vtfy*(lclock-t_to_c); #declare xtrans=x_target; #declare ytrans=y_target; #end // End of conditional part object{ electron translate xp*x+yp*y } object{ electron translate xtarg*x+ytarg*y } object{ electron translate xtrans*x+ytrans*y } #declare i_s=1; union{ #while(i_s<=6) torus{res[i_s],e_size/3 texture {pigment { color rgbt <.2,.2,.9,.5> } finish{ambient .40 diffuse .50}} rotate x*90} #declare i_e=1; #while(i_e<=nes[i_s]) #declare edraw=1; #if(i_s=i_target) #if(i_e=n_target) #declare edraw=0; #end #end #if(i_s=i_trans) #if(i_e=n_trans) #declare edraw=0; #end #end #if(edraw=1) object{ electron translate res[i_s]*y rotate (i_e-1)/nes[i_s]*360*(-z)} #end #declare i_e=i_e+1; #end #declare i_s=i_s+1; #end } sphere{ 0,ecloud texture {pigment {color rgbf <1,1,1,1>}} hollow interior { media { emission color rgbt <.0,.0,.02,.9> scattering {2} intervals 3 samples 32 method 3 // aa_threshold 0.3 aa_level 5 density {spherical scale ecloud*1.2} } } }