#version 3.1; #include "colors.inc" global_settings { assumed_gamma 1.0 } camera { location <0.0, 5, -50.0> direction 1.0*z right 4/3*x look_at <0.0, 5, 0.0> } sky_sphere { pigment { Black } } light_source { <-30, 30, -30> color rgb 1 } plane { y, -0 pigment { color rgb <0.3,0.4,0.3> } } //The number of branches #declare N = 3; #include "recfrac21.inc" //recursion level used. (decrease if slow parsing, but will reduce the object count) #declare Lvl = 6; #declare S = seed(222); //random number generator. #macro r1() (rand(S)+0.5) #end #declare mI = 10; //the amount of plats used. higher gives more unique objects #declare I = mI; #declare objArr = array[I+1] #while(I>=0) purge() AddPoint(<0,0,0>,<0,0,0>, <0,1,0>) AddPoint(<0,0,0>,<0,180/Lvl *r1() ,-20*r1()>, <0,.5*r1(),0>) AddPoint(<0,0,0>,<0,-180/Lvl*r1(), 20*r1()>, <0,0.5*r1(),0>) #declare objArr[I] = object {Draw3(Lvl, 0.05, 0.97, <0,0,0>, <0,1,0>)} #debug concat(str(I,-1,0),"\n") #declare I = I - 1; #end #declare mMove = 3.2; //How much to move them so they don't go into eachother. #declare mXYZ = 15; //How many rows to have. #declare mZ = mXYZ; #declare mX = mXYZ; #declare Zi = mZ; union { #declare I = 0; #while (Zi>=0) #declare Xi = mX; union { #while(Xi>=0) object { objArr[I] translate x*(Xi*mMove) //Spread it } #debug concat(str(Zi,-1,0)," x ",str(Xi,-1,0)," @ ",str(I,-1,0),"\n") #declare I = I + 1; #if(I>mI) //Don't pass the end of the object arrays #declare I=0; #end #declare Xi = Xi - 1; #end translate z*Zi*mMove } #declare Zi = Zi - 1; #end translate -1/2*x*(mX*mMove) //center it. translate -1/2*z*(mZ*mMove) }