/* tree via L system: tree0.pov Povray 3.1 code Oliver Knill, Feb, 11, 2000 */ camera { location<0,0,-4> up y right x look_at <0,0,4> } light_source { <0, 600,-500> color rgb <1,1,1> } light_source { <0,-600,-500> color rgb <1,1,1> } #declare wood_texture = texture { pigment { color rgb <.5, .4, .3> } normal { bumps .3 scale <.22,.15,.21> } } #declare leaf_texture = texture { pigment { color rgb <0,1,0> } finish {phong .1 phong_size 1 } } #declare leaf = disc { <1,0,0>, <0,0,1>, 1 texture {leaf_texture } normal {wrinkles .2 scale <.5, 1, .2> } scale <0.5,0.2,0.5> } #declare twig = union { cylinder {<0,0,0>,<1,0,0>, 0.1 } sphere {<1,0,0>, 0.1 } texture {wood_texture } } #macro draw_twig(i) #if (i=0) twig #else draw_twig(i-1) #end #end #macro draw_leaf(i) #if (i=0) object{ leaf } #else union { object{ draw_twig(i-1) translate -x } object{ draw_leaf(i-1) rotate z*45 rotate x*0*360/3 } object{ draw_leaf(i-1) rotate z*45 rotate x*1*360/3 } object{ draw_leaf(i-1) rotate z*45 rotate x*2*360/3 } translate x scale 0.6 } #end #end #macro draw_plant(i) object{ draw_leaf(i) rotate z*90 translate y*(-0.8) scale 2.0 rotate y*20} #end draw_plant(5)