/*========================================================= Una struttura ricorsiva 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,0,-4> right x*image_width/image_height look_at 0 angle 35 } default { finish { ambient 0.3 diffuse 0.5 } } light_source { <3,10,-10> color 1 } sky_sphere { pigment { gradient y color_map { [0.0 color rgb <0.7,0.7,1.0>] [1.0 color blue 0.5] } } } plane { -z,0 pigment { Orange } } #macro Hex(L) union { #local Scale = 0.63; #local Length = 0.4; cone {0, 0.1, y*Length, 0.1*Scale } sphere {0,0.1} #if(L=0) sphere {y*Length,0.4*Scale texture {Gold_Metal} } #else object { Hex(L-1) rotate 60*z scale Scale translate y*Length } object { Hex(L-1) rotate -60*z scale Scale translate y*Length } #end } #end #declare TheHex = union {Hex(9) texture {Silver_Metal}} object {TheHex} object {TheHex rotate 120*z} object {TheHex rotate 240*z}