// Last edited on 2005-01-06 00:23:30 by stolfi // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tinta_A = texture { pigment { color rgb < 0.10, 0.80, 1.00 > } finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 } } #declare tinta_B = texture { pigment { color rgb < 1.00, 0.80, 0.5 > } finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 } } #macro bola(raio) sphere { <0,0,0>, raio texture{tinta_A} } #end #macro arvore3d(nivel,profundidade) #local dx = (pow(2,profundidade)*nivel*4)/(profundidade); #local dz = profundidade*8; #local ang = 360/nivel; #if (profundidade<=1) object{bola(dx/(nivel*4))} #else #if (nivel = 1) union { object{arvore3d(nivel,profundidade-1) translate <0,0,-dz>} object{bola(nivel/2)} cylinder { <0,0,0>, <0,0,-dz>, 0.1 texture {tinta_B} } } #else union { #while (ang<=360) object{arvore3d(nivel,profundidade-1) translate rotate ang*z} object{bola(dx/pow(nivel,profundidade))} cylinder { <0,0,0>, , 0.1 texture{tinta_B} rotate (ang)*z } #local ang = ang + 360/nivel; #end } #end #end #end object {arvore3d(6,3)} #include "camlight.inc" camlight(<0,0,0>,<285,285,255>,1.00,z,1.0)