// Last edited on DATE TIME by USER
// Processed by remove-cam-lights

#include "textures.inc"
#include "colors.inc"
#include "stones.inc"
#include "metals.inc"
#include "woods.inc"
#include "finish.inc"
#include "shapes.inc"
#include "skies.inc"
#include "chars.inc"
#include "stars.inc"

background{ color rgb < 0.80, 0.80, 1.00>  }

#declare preto =
  texture {
    pigment { color rgb < 0.00, 0.00, 0.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.015 ambient 0.4 }
  }

#declare verde =
texture {
    pigment { color rgb < 0.20, 0.80, 0.20 > }
    finish { diffuse 0.5 specular 0.0 roughness 0.05 ambient 0.1 }
  }

#declare azul =
texture {
    pigment { color rgb < 0.70, 0.70, 1.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.05 ambient 0.1 }
  }

#declare branco =
texture {
    pigment { color rgb < 1.00, 1.00, 1.00 > }
    finish { diffuse 0.7 specular 0.3 roughness 0.00005 ambient 0.1 }
  }

#declare amarelo =
texture {
    pigment { color rgb < 1.0,1.00, 0.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare fundo =
  plane{<0,0,1>, 0
    texture{
      pigment {granite scale <16,16,16> }
      finish  {ambient 0.1 diffuse 0.9 }

  }
}

sky_sphere{S_Cloud4}

#declare apontador =
  union{
    cylinder{
      <0.00,0.00,0.00>,
      <0.00,0.00,2.00>,
      0.25
      texture {Brass_Metal}
    }
    cone{
      <0.00,0.00,2.00>,0.40,
      <0.00,0.00,2.50>,0.00
      texture {amarelo}
    }
  }

#declare folha =
  sphere {
      <0.00,0.00,0.00>,
      1.00
      texture {Red_Marble}

    }

#declare nodo =
  union{
    object{folha}
    object{apontador rotate 180*y rotate  80*x }
    object{apontador rotate 180*y rotate -80*x }
    object{apontador rotate 180*y rotate  80*y }
    object{apontador rotate 180*y rotate -80*y }
  }

#declare deltay = (2.50*0.984);
#declare deltaz = (2.50*0.173 );
#macro arvore(altura,posx, posy,posz)

  #if (altura = 1)
    object{folha translate<posx,posy,posz>}
  #else
    union{
      object{nodo translate<posx,posy,posz>}
      arvore(altura-1,posx,posy-deltay,posz-deltaz-1)
      arvore(altura-1,posx,posy+deltay,posz-deltaz-1)
      arvore(altura-1,posx-deltay,posy,posz-deltaz-1)
      arvore(altura-1,posx+deltay,posy,posz-deltaz-1)
    }
  #end
#end

union{
 object {fundo}
 arvore(9,0.00,0.00,100.00)

}

#include "camlight.inc"
camlight(<0.00,2.00,85.00>,<40.00,20.00,100.00>-<0.00,2.00,85.00>,1.00,z,1.0)