/*; Persistence Of Vision raytracer version 3.5 sample file. Antialias=on Antialias_Threshold=0.3 Antialias_Depth=3 Input_File_Name=chromatic_aberration.pov Output_File_Name=frames/chromatic_aberration Initial_Frame=1 Final_Frame=360 Initial_Clock=.0 Final_Clock=1 Cyclic_Animation=off Pause_when_Done=off +FC */ #version 3.5; #include "colors.inc" #include "glass.inc" #include "textures.inc" #include "mrg_misc2.inc" #include "wavelengthed.inc" //events #declare lclock=clock+.0; #declare t1=ltrans(lclock/.2); //trace rays cross system #declare t2=transitor(lclock,.3,.2); // fade in labels #declare t3=transitor(lclock,.5,.4); // stop down aperature global_settings { assumed_gamma 1.0 ambient_light .5 } background{ color rgb .0} #declare cf=3; camera { location <-0, 0, -4.0>*cf direction 1.5*z right x*image_width/image_height look_at <1, 0.0, 0.0> angle 52/cf } light_source { <0, 0, 0> // light's position (translated below) color rgb <1, .5, 1> // light's color translate <-30, 30, -30> } // ---------------------------------------- //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}} //texture{T_Glass2} scale <.4,2,2> } //axis and focal points cylinder{ -1.5*x,3*x .01 no_reflection no_shadow texture{pigment { color rgb <.8,.6,.1> } finish{ambient 1 diffuse 1}} } #declare fpl =function(ll) {1.9+.6*(ll-400)/300} #declare fpred=fpl(700); #declare fpviolet=fpl(400); #if(t2>0) #declare clrr=ss_spline(700).x*c_spline(700)+<0,0,0,1-t2>; sphere{ x*fpred,.02 scale <1,1.25,1.25> no_reflection no_shadow texture{pigment { color rgbt clrr } finish{ambient 1 diffuse 1}} } text { ttf "arial.ttf", "Red Focal Point",.05,0 texture{pigment { color rgbt clrr } finish{ambient 1 diffuse 1}} no_shadow no_reflection scale .1 translate fpred*x+.55*y-.45*x } cylinder{fpred*x+.05*y, fpred*x+.5*y,.0075 translate -.0051*z texture{pigment { color rgbt clrr } finish{ambient 1 diffuse 1}} no_shadow no_reflection } #declare clrv=ss_spline(400).x*c_spline(400)+<0,0,0,1-t2>; sphere{ x*fpviolet,.02 scale <1,1.25,1.25> no_reflection no_shadow texture{pigment { color rgbt clrv } finish{ambient 1 diffuse 1}} } text { ttf "arial.ttf", "Violet Focal Point",.05,0 texture{pigment { color rgbt clrv } finish{ambient 1 diffuse 1}} no_shadow no_reflection scale .1 translate fpviolet*x+.7*y-.4*x } cylinder{fpviolet*x+.05*y, fpviolet*x+.665*y,.0075 translate -.0051*z texture{pigment { color rgbt clrv } finish{ambient 1 diffuse 1}} no_shadow no_reflection } #end //aperature #declare apt_r=1.2*(1-t3)+.3*t3; #declare apt_t=.075; #declare apt_outr=1.3; #declare apt_offset=.14; #declare apt_p5= box { <-apt_t/2, apt_r, -.1>, translate -apt_offset*x texture{pigment { color rgb <.2,.2,.2> } finish{ambient .5 diffuse .2 specular .2}} no_reflection no_shadow }; object{apt_p5} object{apt_p5 scale <1,-1,1>} #declare yfplh=function(xx,ll,hh) {(1-xx/fpl(ll))*hh} //rays #declare rdy=.2; #declare hstart=1.15; #declare h=hstart; #declare rayend=fpl(700)+.25; #declare arrow2x=fpl(700)+.1; #declare alength=.1; #declare rayprogx=-1+(rayend+1)*t1; #declare lmd=400; #while (h>=0) #declare raypair=union{ #if(h-.5+alength) cone{0,.02,alength*x,0 translate h*y-.5*x} #end no_reflection no_shadow texture{ pigment { color rgbt <.8,.8,.8,.5> } finish{ambient 1 diffuse 1 specular 0} } } //outgoing rays #if(rayprogx>0) #declare lmd=400; #while(lmd<=700) union{ cylinder{rayprogx*x+yfplh(rayprogx,lmd,h)*y, h*y,.0075} #if(rayprogx-alength>arrow2x) cone{0,.02,vx*x+vy*y,0 translate arrow2x*x+yfplh(arrow2x,lmd,h)*y} #end texture{ pigment {color rgbt ss_spline(lmd).x*c_spline(lmd)+<0,0,0,.8> } finish{ambient 1 diffuse 1 specular 0} } } #declare lmd=lmd+100; #end #end #else union{ cylinder{-1*x+h*y, h*y-(apt_t/2+apt_offset)*x,.0075 } cone{0,.02,alength*x,0 translate h*y-.5*x} no_reflection no_shadow texture{ pigment { color rgbt <.8,.8,.8,.5> } finish{ambient 1 diffuse 1 specular 0} } } #end } object{raypair} object{raypair scale <1,-1,1>} #declare h=h-rdy; #end #declare clcx=(fpl(400)+fpl(700))/2; #declare clcr = abs(yfplh(clcx,lmd,-apt_r)); #if(t2>0) union{ cylinder{-.0001*x,.0001*x, clcr translate x*clcx} torus { clcr, 0.005 scale <1,1.5,1> rotate z*90 translate x*clcx } cylinder{-(clcr+.04)*y,-.9*y,.0075 translate clcx*x} no_shadow no_reflection texture{pigment { color rgbt <.0,.75*t2,.0, 1-t2> } finish{ambient .5 diffuse 1} } } text { ttf "arial.ttf", "\"Best\" Focus",.05,0 texture{pigment { color rgb <.0,.75,.0>*t2 } finish{ambient 1 diffuse 1}} no_shadow no_reflection scale .1 translate clcx*x-y-.3*x } #end /* */