// Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3.5 /* Antialias=on Antialias_Threshold=0.3 Antialias_Depth=3 Input_File_Name=coma_aberration.pov Output_File_Name=frames/coma_aberration Initial_Frame=1 Final_Frame=480 Initial_Clock=.0 Final_Clock=1.2 Cyclic_Animation=off Pause_when_Done=off +FC */ #include "colors.inc" #include "textures.inc" #include "mrg_misc2.inc" /* transitions start: side view with labels for object, lens and image plane T1: trace principle ray T2: rotate viewpoint to look "downstream" for n=1 to 4 T2n+1: trace ray pairs from outer part of loop htting lens at n*h T2n+2: rotate lense incident points about principle rays, tracing incident point circles as well as ray focus circle T11: rotate view to look "upstream" */ #declare lclock=clock+1.1; #declare tmark=1; #declare tr= array[12]; #while (tmark<=11) #declare tr[tmark]=ltrans((lclock-tmark*.1)/.1); #declare tmark=tmark+1; #end global_settings { assumed_gamma 1.0 ambient_light .5 } background{ color rgb .0} #declare cf=75; #declare c_persp_ang=tr[2]*50+tr[11]*(-50-60); camera { location vrotate(<0, .2, -8>*cf,c_persp_ang*y) direction 1.5*z right x*image_width/image_height look_at <.5, 0, 0.0> angle 50/cf } light_source { <0, 0, 0> // light's position (translated below) color rgb <1,1,1>*.5 // light's color translate <-30, 30, -30> } // ---------------------------------------- #declare Os=2; #declare Oy=.5; #declare Osp=3; #declare Oyp=Osp/Os*Oy; // the object sphere{<-Os,-Oy,0>,.025 no_reflection no_shadow texture{pigment { color rgb <1,.0,.0> } finish{ambient 2 diffuse 0}} } cylinder{<-Os,-Oy,0>,<-Os,0,0>,.01 no_reflection no_shadow texture{pigment { color rgb <.6,.6,.6> } finish{ambient 1 diffuse 0}} } text { ttf "arial.ttf", "object",.05,0 texture{pigment { color rgb <1,.0,.0> } finish{ambient 2 diffuse 1}} no_shadow no_reflection scale .15 translate -.17*x-.2*y rotate c_persp_ang*y translate -Os*x-Oy*y } //the image sphere{,.025 no_reflection no_shadow texture{pigment { color rgb <1,.8,.3> } finish{ambient 2 diffuse 0}} } cylinder{,,.01 no_reflection no_shadow texture{pigment { color rgb <.6,.6,.6> } finish{ambient 1 diffuse 0}} } //principle ray #if(tr[1]>0) #declare prstart=<-Os,-Oy,0>; #declare prend=prstart+tr[1]*(-prstart); cylinder{prstart,prend,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } #end #declare dy = function(yp,h){.5*yp*h*h} #declare n=1; #while (n<=4) #if(tr[2*n+1]>0) #declare h=.2*n; #declare dr=dy(Oyp,h); #declare theta1=pi*tr[2*n+2]; #declare theta2=pi*(1+tr[2*n+2]); #declare rays=union{ cylinder{<-Os,-Oy,0>,<0,h*cos(theta1),h*sin(theta1)>,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } cylinder{<0,h*cos(theta1),h*sin(theta1)>,,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } cylinder{<-Os,-Oy,0>,<0,h*cos(theta2),h*sin(theta2)>,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } cylinder{<0,h*cos(theta2),h*sin(theta2)>,,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } } #if(tr[2*n+1]<1) difference{ object{rays} cylinder{(-Os+tr[2*n+1]*(Osp+Os))*x,5*x,2} } #else object{rays} torus{dr,.01 scale <1,.2,1> no_reflection no_shadow texture{pigment { color rgb <1,.8,.3> } finish{ambient 2 diffuse 0}} rotate 90*z translate } torus{h,.01 scale <1,.2,1> no_reflection no_shadow texture{pigment { color rgb <.3,.3,1> } finish{ambient 2 diffuse 0}} rotate 90*z } #end #end #declare n=n+1; #end #declare h=.2; #while(h<0) #declare theta1=pi/2; #declare dr=dy(Oyp,h); #declare ray_p1=<-Os,-Oy,0>; #declare ray_p2=<0,h*cos(theta),h*sin(theta)>; #declare ray_p3=; cylinder{ray_p1,ray_p2,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } cylinder{ray_p2,ray_p3,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } torus{dr,.01 scale <1,.2,1> no_reflection no_shadow texture{pigment { color rgb <1,.8,.3> } finish{ambient 2 diffuse 0}} rotate 90*z translate } torus{h,.01 scale <1,.2,1> no_reflection no_shadow texture{pigment { color rgb <.3,.3,1> } finish{ambient 2 diffuse 0}} rotate 90*z } #declare theta=1.5*pi; #declare dr=dy(Oyp,h); #declare ray_p1=<-Os,-Oy,0>; #declare ray_p2=<0,h*cos(theta),h*sin(theta)>; #declare ray_p3=; cylinder{ray_p1,ray_p2,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } cylinder{ray_p2,ray_p3,.01 no_reflection no_shadow texture{pigment { color rgb <.6,1,.6> } finish{ambient 2 diffuse 0}} } #declare h=h+.2; #end //lens intersection{ sphere{0,1 translate .8*x} sphere{0,1 translate -.8*x} texture{ pigment { color rgbt <.1,.1,.9,.7> } finish{ambient .4 diffuse .4 specular 0.9} } scale <.4,1.5,1.5> } text { ttf "arial.ttf", "lens",.05,0 texture{pigment { color rgb <0,.0,1> } finish{ambient 2 diffuse 1}} no_shadow no_reflection scale .15 translate -.11*x-1.05*y rotate c_persp_ang*y } //axis cylinder{-2.5*x,3.5*x .01 no_reflection no_shadow texture{pigment { color rgb <.6,.6,1> } finish{ambient 2 diffuse 0}} } #declare screensize=3; box { , no_reflection no_shadow texture{pigment { color rgbt <.8,.8,.8,.6> } finish{ambient 1 diffuse 0}} } text { ttf "arial.ttf", "image plane",.05,0 texture{pigment { color rgb <.5,.5,.5> } finish{ambient 2 diffuse 1}} no_shadow no_reflection scale .15 translate -.40*x-.2*y rotate c_persp_ang*y translate Osp*x-screensize/2*y }