// Last edited on 2003-10-14 19:33:36 by stolfi

// ======================================================================
// CÂMERA 

#declare ctr = <  0.00, 0.00, 5.00 >;
#declare camdir = <  -10.00, 107.00, 30.00 >;
camera {
  location  ctr + 0.75*camdir  // Posição do observador.
  right     -0.60*x                 // Largura RELATIVA da imagem.
  up        0.80*y                 // Altura RELATIVA da imagem.      
  sky       z                      // Qual direção é "para cima"?
  look_at   ctr  // Para onde a câmera está apontando.
} 
// Nota: os parâmetros "right" e "up" devem ter a mesma proporção
// que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile.

// ======================================================================
// FONTES DE LUZ

light_source {
  10 * < 80.0, 100.0, 30.0 >              // Posição da lâmpada.
  color rgb 1.2 * < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
} 

light_source {
  10 * < -50.0, -30.0, 0.0 >             // Posição da lâmpada.
  color rgb 1.2 * < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
} 

// ======================================================================
// DESCRIÇÃO DA CENA 

background{ color rgb < 0.75, 0.80, 0.85 > }

#declare p1 = 
  texture {
    pigment { color rgb < 0.40, 0.70, 1.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare p2 = 
  texture {
    pigment { color rgb < 0.10, 0.10, 0.10 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.05 ambient 0.1 }
  }

#declare p3 = 
  texture {
    pigment { color rgb < 0.40, 0.40, 0.40 > }
    finish { diffuse 0.5 specular 1.0 roughness 0.05 ambient 0.1 }
  }
  

#declare cabeca1 = torus { 4, 2.5 texture {p1} rotate <90,0,0>}

#declare cabeca2 = cylinder {<0,0,2.5> <0,0,-2.5> 4 texture {p1}}

#declare olho = sphere { <0,0,0> 1 texture {p2}}

#declare pescoco = cylinder {<0,0,0> <0,0,14> 1 texture {p3}}

#declare cabeca = 
union {
  union {
    object {cabeca1}
    object {cabeca2}
    object {olho translate <-4.6,4.6,0>}
    object {olho translate <4.6,4.6,0>}
    translate <0,0,14>
  }
  object {pescoco}
}

#declare arco = 
intersection {
  object {torus{16,1}}
  object {box{<-20,-20,0>,<0,20,20>}}
  texture {p3}
}

#declare pe = 
intersection {
  object { sphere {<0,0,0>, 2}}
  object { box {<-4,-4,0>,<4,4,4>}}
  texture {p1}
}

#declare perna =
union {
  object {arco}
  object {pe translate <-16,0,0>}
  translate <0,0,-16>
}

#declare pernas =
union {
  object {perna rotate <0,0,-45>}
  object {perna rotate <0,0,225>}
}

#declare mao = sphere {<0,0,0>,2 texture {p1}}

#declare braco = 
union {
  object {arco}
  object {mao translate <-16,0,0>}
  translate <0,0,-16>
}

#declare bracos =
union {
  object {braco rotate <45,0,0> rotate<0,-20,0>}
  object {braco rotate <45,0,0> rotate<0,-20,0> scale<-1,1,1>}
}

#declare haste = cylinder {<0,0,18> <0,0,0> 1 texture {p3}}

#declare peito = sphere {<0,0,0> 4 texture {p1}}

#declare quadril = sphere {<0,0,0> 2 texture {p1}}

#declare tronco = 
union {
  object {haste}
  union {
    object {peito}
    object {bracos} 
    translate <0,0,18>
  }
  object {quadril}
}

union {
  union {
    object {cabeca rotate <15,0,0>translate<0,0,18>}
    object {tronco}
    rotate <-20,0,0>
  }
  object {pernas}
}