//Description: // cool recursion animation // still frame taken at clock = 3.05 //Author: Ben Scheele //Date: 3-21-02 #declare rad = 1; global_settings{ #if(rad = true) radiosity{ pretrace_start 0.08 pretrace_end .01 count 100 nearest_count 6 error_bound 1.65 recursion_limit 1 low_error_factor 0.65 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 } ambient_light off #end } light_source{ 20 rgb 1 } light_source{ <-100,1000,-200> rgb 1 } sky_sphere{ pigment{ gradient y triangle_wave color_map{ [ 0.0 rgb <.8,.9,1> ] [ 0.5 rgb <.7,.7,1> ] [ 1.0 rgb <.6,.6,.7>] } rotate 90*z } } #macro Recursion(lev,rad) #if(lev > 0 ) sphere{ 0, rad pigment{ rgb <.4,.2,.7> } finish{ ambient .4 phong 2 phong_size 80 diffuse .8 metallic .3 specular .3 roughness .1 reflection{ .15 .35 } } } #end #local n = .5; #if(clock <= 1) #declare b = 30*(1-clock); #declare Y = 6 + 12*clock; #declare Z = 11*(1-clock); #declare Y2= 1 - clock; #end #declare clock2 = (clock-1)*12/25; #if(clock > 1) #declare b = 180 + 62.5*clock2; #declare Y = 18 - 13*clock2; #declare Z = 9*clock2; #declare Y2= -1.5*clock2; #end #if (lev < lmax) union{ Recursion(lev+1,rad*n) translate rotate <0,0,b> } union{ Recursion(lev+1,rad*n) translate <-rad*(1+n),0,0> rotate <0,0,-b> } union{ Recursion(lev+1,rad*n) translate <0,0,rad*(1+n)> rotate <-b,0,0> } union{ Recursion(lev+1,rad*n) translate <0,0,-rad*(1+n)> rotate } #end #end #declare lmax = 7; Recursion (0,1) camera { location <0,Y,Z> up y right x look_at <0,Y2,0> angle 20 }