// Segundo exercicio de MP004
// Last edited on 2001-05-19 16:09:00 by Marcus Macedo

#include "colors.inc"

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

light_source {
  < 9.00, 9.00, 14.00 >
  color rgb < 1.00, 1.00, 1.00 >
} 

camera {
  location  <  10.00, 0.00, 11.00 >
  right     < -1.20, 0.00, 0.00 >
  up        <  0.00, 0.00, 0.90 >
  sky       <  0.00, 0.00, 5.00 >
  look_at   <  0.00, 0.00, 3.50 >
} 

#declare verde_rugoso_claro = 
  texture {
    pigment { color rgb < 0.25, 1.00, 0.25 > }
    normal { bumps 0.4 scale 0.2 }
    finish { phong 1 }
  }

#declare verde_normal_liso = 
  texture {
    pigment { color rgb < 0.00, 1.00, 0.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }
  
#declare verde_escuro = 
  texture {
    pigment { color rgb < 0.00, 0.35, 0.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare cabeca_tronco =
blob {
  threshold 0.2
  sphere { < 0.00, 0.00, 4.30 >, 1.50, 1 scale< 1, 1, 1.50> texture {verde_rugoso_claro} }
  sphere { < 0.00, 0.00, 4.50 >, 1.50, 1 texture {verde_escuro} }
  sphere { < 0.00, 0.50, 3.00 >, 1.50, 1 texture {verde_escuro} }
  sphere { < 0.00, -0.50, 3.00 >, 1.50, 1 texture {verde_escuro} }
}

#declare perna_esquerda =
blob {
  threshold 0.1
  sphere { < 0.00, 1.00, 1.00 >, 1.00, 1 texture {verde_normal_liso} }
  sphere { < 0.00, 0.75, 1.75 >, 0.75, 1 texture {verde_normal_liso} }
}

#declare perna_direita =
blob {
  threshold 0.1
  sphere { < 0.00, -1.00, 1.00 >, 1.00, 1 texture {verde_normal_liso} }
  sphere { < 0.00, -0.75, 1.75 >, 0.75, 1 texture {verde_normal_liso} }
}

#declare braco_direito =
blob {
  threshold 0.1
  sphere { < 0.00, -1.30, 4.35 >, 0.55, 1 texture {verde_normal_liso} }
  sphere { < 0.00, -1.65, 5.00 >, 0.65, 1 texture {verde_normal_liso} }
}

#declare braco_esquerdo=
blob {
  threshold 0.1
  sphere { < 0.00, 1.30, 4.25 >, 0.55, 1 texture {verde_normal_liso} }
  sphere { < 0.00, 1.65, 5.00 >, 0.65, 1 texture {verde_normal_liso} }
}

object {cabeca_tronco}
object {perna_esquerda}
object {perna_direita}
object {braco_direito}
object {braco_esquerdo}