//Description: //Finally Fixed that Random Rotation Walking, //now does what I want it to, //result turned out more creepy than expected // //Author: Ben Scheele //Date: 5-17-2004, 6-3-2004 global_settings{ radiosity{ pretrace_start 0.08 pretrace_end .01 count 100 nearest_count 6 error_bound 1.65 recursion_limit 1 low_error_factor 0.6 gray_threshold 0.0 minimum_reuse 0.015 brightness .8 adc_bailout 0.01/2 } } camera{ location -3800*z up y right x look_at 0 angle 35 } light_source{ <150,800,-1000> rgb .8 } light_source{ <-500,-750,-1500> rgb .75 } background{ rgb <1,.9,.8> } plane{ z, 40 pigment{ rgb .5 } finish{ reflection .2 } hollow } #declare BTSfin= finish{ ambient .3 diffuse .8 phong .5 reflection{ .2 .5 } metallic .3 specular .2 roughness .02 } #declare b = <0,0,0>; #declare s = seed(777); #declare n = x; #declare q = 15; //lower means less rotation, straighter path #declare l = 1000; //needs to be at least 300 for effect to work. Use more spheres for larger area #declare T = 0; #declare EndT = 200000; //number of shperes in path, determines its length #while(T < EndT) #declare c = T/EndT; //fraction of path traveled //random walk mechanics #if(rand(s) <= .5) #declare n = vrotate(n,q*(rand(s))*z); #else #declare n = vrotate(n,-q*(rand(s))*z); #end //set boundaries #if(vlength(b) >= l) #declare n = //vrotate(n,-vlength(b)/2*z); //sharp turn vrotate(n,-q*(rand(s))*z); //more gradual turn #end #if(vlength(b) <= l/3) // l/3 is radius of hole #declare n = //vrotate(n,vlength(b)/2*z); //sharp turn vrotate(n,q*(rand(s))*z); //more gradual turn #end sphere{ 0, 1 pigment{ rgb } finish{ BTSfin } scale 4*<4-3.5*c,4-3.5*c,1+10*c> #if(T = 0) #declare b = b + ; //initial position #end translate b } #declare b = b + n; #declare T = T + 1; #end