/*========================================================= Figura ricorsiva Metodi e Modelli Matematici Gian Marco Todesco, gennaio 2007 http://archinet.uniroma3.it/mate/metodi/2007 =========================================================*/ #include "colors.inc" #include "textures.inc" camera { location <0,0,-9> right x*image_width/image_height look_at <0,0,0> angle 50 } light_source { <1,4,-2> color 1} light_source { <-1,2,-6> color 1 shadowless} plane { -z,0 pigment {checker White Orange }} #declare ExpFactor = 0.6; #declare Theta = pi*0.6; #declare Ricciolo = union { #local BaseR = 0.13; #local N = 100; #local OldP = <0,0,0>; #local OldR = BaseR; #local I = 1; #while(I; #local R = BaseR*exp(-T*ExpFactor); cone {OldP,OldR, P,R} sphere {P,R} #local OldP = P; #local OldR = R; #local I=I+1; #end texture {Silver_Metal} } #declare Transform = transform { scale exp(-ExpFactor) translate -x rotate -degrees(Theta)*z translate x } #macro Pianta(L) #if(L>0) union { object {Ricciolo} object {Pianta(L-1) transform {Transform} } object {Pianta(L-1) rotate 180*y transform {Transform} } } #else object {Ricciolo} #end #end #declare Branch = object { Pianta(8) } union { object { Branch } object { Branch rotate 120*z } object { Branch rotate 240*z } rotate 40*z translate -0.5*y }