// Last edited on 2005-01-06 00:19:25 by stolfi // Processed by remove-cam-lights #declare g = seed(23443); background{ color rgb < 0.75, 0.80, 0.85 > } #declare texturaTronco = texture { pigment { color rgb <0.3,0.3,0.1> } }; #declare texturaFolha = texture { pigment { color rgb <0,0.9,0> } }; #declare MAX_LEVELS = 6; #macro RandMM(l1, l2) rand(g)*(l2-l1)+l1 #end #macro Arvore(level, h, r, angZ, angY) object { union { #local hC = h*0.5*((MAX_LEVELS-level)/MAX_LEVELS) + h*0.5; #local rC = 0.75*r*((MAX_LEVELS-level)/MAX_LEVELS) + 0.25*r; cylinder { <0,0,0>,<0,hC,0>,rC texture {texturaTronco} } sphere { #if (level = MAX_LEVELS) <0,hC,0>,rC*6 texture {texturaFolha} #else <0,hC,0>,rC*1.4 texture {texturaTronco} #end } #if (level < MAX_LEVELS) #local ramos = RandMM(0,10); #local i = 0; #while (i < ramos) object { Arvore((level+1), hC, rC, RandMM(25,50), RandMM(0,360)) translate <0,hC,0> } #local i = i + 1; #end #end } rotate angZ*z rotate angY*y } #end plane {y, 0 texture { pigment{checker <0.2,0.2,0.2>,<0.3,0.3,0.3>} finish {ambient 0.2 diffuse 0.8 reflection 0.05} scale 30.0 } } object { Arvore(1, 25, 2, 0, 0) } #include "camlight.inc" camlight(<0,25,0>,<110,55,200>,1.00,y,1.0)