// Diffusion Limited Aggregation / Blue Cup '00.10 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { assumed_gamma 2.2 } light_source {<0, 150, -50> color <1,1,1>} camera { location <0,50,-100> angle 40 look_at <0, 15, 0> } #declare R1 = seed(7); #macro Dla15(Nmax) #declare Rmax=2.5; #declare Cp=array[Nmax][3] #declare Cp[0][0]=0; #declare Cp[0][1]=0; #declare Cp[0][2]=0; sphere { 1 pigment {color rgbt <1,1,1,0.8>} finish { reflection 1 phong 2 brilliance 1 ambient 0.4 } no_shadow } #declare Np=1; #while (Np0) #declare Cp[Np][0]=Cpx*Nt/Ntmax; #declare Cp[Np][1]=Cpy*Nt/Ntmax; #declare Cp[Np][2]=0.02*(Cp[Np][0]*Cp[Np][0]+Cp[Np][1]*Cp[Np][1]); #declare Ns=Np-1; #while (Ns>-1) #if ((Cp[Np][0]-Cp[Ns][0])*(Cp[Np][0]-Cp[Ns][0])+(Cp[Np][1]-Cp[Ns][1])*(Cp[Np][1]-Cp[Ns][1])+(Cp[Np][2]-Cp[Ns][2])*(Cp[Np][2]-Cp[Ns][2])<8) #declare Ntmaxd=(Nt+1)/Ntmax*Ro*10; #declare Cpxd=Cpx*(Nt+1)/Ntmax; #declare Cpyd=Cpy*(Nt+1)/Ntmax; #declare Ntd=Ntmaxd; #while (Ntd>0) #declare Cp[Np][0]=Cpxd*Ntd/Ntmaxd; #declare Cp[Np][1]=Cpyd*Ntd/Ntmaxd; #declare Nsd=Np-1; #while (Nsd>-1) #if ((Cp[Np][0]-Cp[Nsd][0])*(Cp[Np][0]-Cp[Nsd][0])+(Cp[Np][1]-Cp[Nsd][1])*(Cp[Np][1]-Cp[Nsd][1])+(Cp[Np][2]-Cp[Nsd][2])*(Cp[Np][2]-Cp[Nsd][2])<4) #declare Nsclose=Nsd; #declare Nsd=0; #declare Ntd=1; #end #declare Nsd=Nsd-1; #end #declare Ntd=Ntd-1; #end #declare Ns=0; #declare Nt=1; #end #declare Ns=Ns-1; #end #declare Nt=Nt-1; #end #declare Rmax=max(sqrt(Cp[Np][0]*Cp[Np][0]+Cp[Np][1]*Cp[Np][1]),Rmax); sphere { 1 pigment {color rgbt <1-Np/Nmax,1-Np/Nmax,1,0.8>} finish { reflection 1 phong 2 brilliance 1 ambient 0.4 } no_shadow rotate x*-90 } #declare Np=Np+1; #end #end Dla15(70) //(700)