/*========================================================= Un albero molto semplice. Perturbazione casuale sui rami Metodi e Modelli Matematici Gian Marco Todesco, ottobre 2007 http://archinet.uniroma3.it/mate/metodi/2007 =========================================================*/ #include "colors.inc" #include "textures.inc" camera { location <0,1,-4> right x*image_width/image_height look_at y angle 40 } default { finish { ambient 0.4 diffuse 0.5 } } light_source { <3,10,-10> color 1 } light_source { <0,1,-4> color 0.2 shadowless} sky_sphere { pigment { gradient y color_map { [0.0 color rgb <0.7,0.7,1.0>] [1.0 color blue 0.5] } } } plane { y,0 pigment { ForestGreen } } #declare Seed = seed(105); #macro Tree(L) #local Scale = 0.6; #local Length = 0.8; // tronco cone {0, 0.1, y*Length, 0.1*Scale texture {Yellow_Pine}} #if(L=0) // alla fine c'e' una bacca verde sphere {y*Length,0.1+0.4*rand(Seed) pigment {LimeGreen}} #else // altrimenti sotto-alberi (da 2 a 7) #local I = 0; #local N = 3 + floor(rand(Seed)*4); #while(I