// Diffusion Limited Aggregation / Red Leaf '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, 100, -150> color <1,1,1>} camera { location <0,-50,-100> angle 50 look_at <20, 0, 0> } #declare R1 = seed(12); #macro Dla2(Nmax) #declare Rmax=2.5; #declare Cp=array[Nmax][2] #declare Cp[0][0]=0; #declare Cp[0][1]=0; sphere { 1 pigment {color rgbt <1,1,0,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 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])<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])<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,1-Np/Nmax,0,0.8>} finish { reflection 1 phong 2 brilliance 1 ambient 0.4 } no_shadow } #declare Np=Np+1; #end #end Dla2(70) //(500)