// BEADS / Cup '99.12 (v.1.2 '00.01) // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { max_trace_level 6 assumed_gamma 2.2 } light_source {<40, -100, -50> color <1,1,1>} camera { location <-10,-80,-100> angle 60 look_at <7, 40, 0> } #declare Rndm = seed(89); #declare Rdg=46; //radius of arranging sphere //initialize the coordinates of beads (X=Cp[I][0] Y=Cp[I][1]) #declare Imax=4200; #declare Cp=array[Imax][2] #declare I=0; #while (I0.3) #declare Ad=0.5*rand(Rndm); #end //confuse the arrangement #if (Ae-Ap<0) #declare Ap=Ap-2*pi; #end #declare Bo=acos(1/Rdg/tan(pi-2*Ao)); #if (Ao>pi/4) #declare Rb=2*Bo/pi; #else #declare Rb=1; #end #if (Ae-Ap-As-Al-Ad>0) #declare I=0; #while (I0) #declare I=0; #while (Ipi/2-1/Rdg) #declare Jd=Jdl; #end #declare Jd=Jd+1; #end #declare I=0; #while (I0) #declare Ai=sqrt(Cp[I][0]*Cp[I][0]+Cp[I][1]*Cp[I][1])/2/Rdg; #declare Ri=sin(Ai)*cos(Ai)/Ai; #else #declare Ai=0; #declare Ri=1; #end //arranging beads sphere { 1 pigment { color rgbt <1-0.7*I/Pe,0.3+0.7*I/Pe,0,0.99> } finish { reflection 1.5 ambient 0.2 phong 0.3 brilliance 0.5 diffuse 2 } } #declare I=I+1; #end background {color rgbt <0.02,0.02,0>}