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






  






  

  





background{ color rgb < 0.50, 0.50, 0.50 > }

#declare roleta = seed(34809);

#declare tinta_verde = 
  texture {
    pigment { color rgb < 0.00, 0.80, 0.20 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare tinta_marrom = 
  texture {
    pigment { color rgb < 0.50, 0.20, 0.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare tinta_chao = 
    texture {
 pigment { color rgb < 0.10, 0.10, 0.10 > }
 finish { ambient 0.1 diffuse 10 phong 10 reflection 0.2 roughness 0.05 brilliance 10 }
    }



#macro galho(P, V, L, R)
    #if (R > 0.04 & sqrt(P.x*P.x + P.y*P.y + (P.z - 20)*(P.z - 20)) < 20) 
       #local q = P + L * V;
       union {
         #local r1 = <0.5 - rand(roleta), 0.5 - rand(roleta), 0.5 - rand(roleta)>;
         #local r2 = <0.5 - rand(roleta), 0.5 - rand(roleta), 0.5 - rand(roleta)>;
         #local u1 = V + r1;
         #local u2 = V + r2;


         object{ galho(q, vnormalize(u1), L - 0.2, R - 0.04) }
         object{ galho(q, vnormalize(u2), L - 0.2, R - 0.04) }
         object{
           cylinder {
             P, q, R
             texture {tinta_marrom}
           }
         }
       }
    #else
      sphere { P 0.3 texture {tinta_verde}}
    #end
#end

#macro arvore(P, V, L, R)
  union {
       object{galho(P, vnormalize(<0, 0, 1>), L, R)}
       object{galho(P, vnormalize(<0, -0.5, 1>), L, R)}
       
  }
#end

union {
  object{arvore(<0,0,4>, <0, 0, 1>, 4, 0.5)}
  object{
    cone {
      <0, 0, 0>, 1
      <0, 0, 4>, 0.5
      texture { tinta_marrom }
    }
  }
  object{
    box {
      < -16, -16, -1 >,
      < 16, 16, 0 >
      texture { tinta_chao }
    }
  }

}

// Original camera parameters:
// #local cam_ctr = <0.00,0,12.00>
// #local cam_vec = (<50.00,0.0,20.00>-<0.00,0,12.00>)
// #local cam_sky = z

#include "camlight.inc"
camlight(<0.00,0,12.00>,<10,10,10>,20.0,z,1.0)