// MC930A Primeira Atividade de Laboratório utilizando POV-ray
// Autor: Mário Riudoms Sangenis  -  RA: 992198

#include "colors.inc"
#include "textures.inc"

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

light_source {
  < 0.00, 10.00, -50.00 >
  color rgb < 1.00, 1.00, 1.00 >
} 

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

#declare corpo =
  cylinder {
    < 0.00, 1.50, 0.00 >,
    < 0.00, -1.50, 0.00 >,
    1.00
    pigment { Blue }
  }
  
#declare braco =
   union {
     sphere{<1.20, 1.00, 0.00>, 0.3 pigment{Red}}
     cylinder{<1.30, 1.00, 0.00>, <2.30, 0.00, 0.00>, 0.22 pigment{Green}}
     sphere{<2.20, 0.00, 0.00>, 0.3 pigment{Red}}
     cylinder{<2.30, 0.00, 0.00>, <1.60, -1.20, 0.00>, 0.2 pigment{Green}}
     cylinder{<1.60, -1.20, 0.00>, <1.40, -1.54, 0.00>, 0.08 pigment{Black}}
     cylinder{<1.40, -1.50, 0.00>, <1.20, -1.35, 0.00>, 0.08 pigment{Black}}
}

#declare perna =
   union {
     sphere{<0.50, -1.70, 0.00>, 0.3 pigment{Red}}
     cylinder{<0.50, -1.90, 0.00>, <0.50, -3.00, 0.00>, 0.25 pigment{Green}}
     sphere{<0.50, -3.20, 0.00>, 0.3 pigment{Red}}
     cylinder{<0.50, -3.40, 0.00>, <0.50, -4.20, 0.00>, 0.23 pigment{Green}}
     cylinder{<0.50, -4.20, 0.00>, <0.50, -4.60, 0.00>, 0.10 pigment{Black}}
     box{<0.10, -4.65, 0.50>, <0.90, -4.45, -0.50> pigment{Black}}
}

#declare cabeca =
   union {
     cylinder{<0.00, 1.50, 0.00>, <0.00, 2.00, 0.00>, 0.30 pigment{Magenta}}
     sphere{<0.00, 1.80, 0.00>, 0.7 pigment{Yellow} scale <1,1.5,1>}
     sphere{<0.00, 2.15, -0.40>, 0.5 pigment{Brown} scale <1.2,1,1>}
}  

#declare cabeca_boca =
   difference {
     object { cabeca }
     cylinder{<2.00, 1.90, -0.90>, <-2.00, 1.90, -0.90>, 0.15}
}

#declare olho =
   union {
     sphere{<-0.25, 2.10, -0.5>, 0.18 pigment{Cyan} scale <1,1.4,1>}
}


// Aqui está a cena, finalmente:

union { 
  object { corpo }
  object { braco }
  object { braco scale <-1,1,1>}
  object { perna }
  object { perna scale <-1,1,1>}
  object { cabeca_boca }
  object { olho }
  object { olho scale <-1,1,1>}
}