/* inversionC.pov A circle inversion demonstration. Based on the formula found at http://www.xahlee.org/SpecialPlaneCurves_dir/Inversion_dir/inversion.html 2009 Sam Benge render with these command line options: +ft +f +a0.01 +am1 +r3 +w2048 +h2048 +kff8 */ global_settings{assumed_gamma 2.2} #default{finish{ambient 1}} camera{ orthographic right x*2 up y*2 location -z*100 look_at 0 } #declare R=seed(1029); #declare n_pts=13; #declare pts=array[n_pts]; #declare radii=array[n_pts]; #declare V=0; #while(V*.25; #declare radii[V]=(.5+rand(R))*.3; #declare V=V+1; #end #declare iter=0; #while(iter<200) #declare V=0; #while(V1) #declare img= pigment{ image_map{tga concat("inversionC", str(frame_number-1,0,0), ".tga" )} scale 2 translate-(x+y) scale 1.5 } #end #declare R=seed(1007); #declare V=0; #while(V; poly_wave .5 color_map{[0 rgb 0][.03 rgb col*1.3][.75 rgb 0]} } scale <1,1,1>*radii[V].z translate scale 2/3 } #else #ifdef(f_pigment)#undef f_pigment #end #declare f_pigment= function{ pigment{ pigment_pattern{boxed scale 1.5} pigment_map{ [0 rgb 0] [.001 img ] } } } #declare circle_x=pts[V].x; #declare circle_y=pts[V].y; #declare circle_diameter=radii[V]; disc{,z,radii[V] pigment{ average pigment_map{ [1 // red component function{ max( f_pigment( (x-circle_x)*pow(circle_diameter,2)/(pow(x-circle_x,2)+pow(y-circle_y,2))+circle_x, (y-circle_y)*pow(circle_diameter,2)/(pow(y-circle_y,2)+pow(x-circle_x,2))+circle_y, 0 ).x, f_pigment(x,y,z).x ) } color_map{[0 rgb 0][1 rgb x*3]} ] [1 // green component function{ max( f_pigment( (x-circle_x)*pow(circle_diameter,2)/(pow(x-circle_x,2)+pow(y-circle_y,2))+circle_x, (y-circle_y)*pow(circle_diameter,2)/(pow(y-circle_y,2)+pow(x-circle_x,2))+circle_y, 0 ).y, f_pigment(x,y,z).y ) } color_map{[0 rgb 0][1 rgb y*3]} ] [1 // blue component function{ max( f_pigment( (x-circle_x)*pow(circle_diameter,2)/(pow(x-circle_x,2)+pow(y-circle_y,2))+circle_x, (y-circle_y)*pow(circle_diameter,2)/(pow(y-circle_y,2)+pow(x-circle_x,2))+circle_y, 0 ).z, f_pigment(x,y,z).z ) } color_map{[0 rgb 0][1 rgb z*3]} ] } } scale 2/3 } #end #declare V=V+1; #end