// TP 1
// Ivan Francisco Coutinho Costa
// RA 001833
// MC930 - Stolfi

#include "colors.inc"

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

light_source {
  < -40.00, -50.00, -100.00 >
  color rgb < 1.00, 1.00, 1.00 >
} 

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

#declare tinta_A = 
  texture {
    pigment { color rgb < 0.10, 0.80, 1.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare tinta_B = 
  texture {
    pigment { color rgb < 1.00, 0.80, 0.10 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

plane {
  y, 12
  pigment { color White } //pigment { checker color Black color White }
}

  
#declare corpo =
  sphere {
    < 0.00, 0.00, 0.00 >, 12.00 
    texture { tinta_A }
  }
  
#declare pescoco = 
  cylinder {
    < 0.00, -12.00, 0.00 >,
    < 0.00, -13.00, 0.00 >,
    2
    texture { tinta_B }
  }
  
#declare cabeca = 
  sphere {
    < 0.00, -17.0, 0.00 >,
    4
    texture { tinta_A }
  }
  
#declare antebraco_direito =
   cylinder {
      <-7.00, -10.00, 0.0>,
      <-16.00, 0.0, -5.00>,
      1
      texture { tinta_B }
}

#declare braco_direito =
     cylinder {
       <-16.00, 0.0, -5.0>,
       <-6.0, 5.0, -14.0>
       1
       texture { tinta_B }
}

#declare antebraco_esquerdo = 
    cylinder {
       <7.0, -10.00, 0.0>,
       <16.0, 0.0, -5.0>,
       1
       texture { tinta_B }
}

#declare braco_esquerdo =
     cylinder {
        <16.0, 0.0, -5.0>,
        <10.0, 5.0, -14.0>
        1
        texture { tinta_B }
}


#declare cabelo_direito =
    cone {
        <-4.0, -17.0, 0.0>, 1.0
        <-5.0, -14.0, 0.0>, 0.1
        texture { tinta_B }
}
         
#declare cabelo_esquerdo =
     cone {
	<4.0, -17.0, 0.0>, 1.0
        <4.0, -14.0, 0.0>, 0.1
        texture { tinta_B }
}


// Aqui está a cena, finalmente:
union {
    object { corpo }
    object { cabeca }
    object { pescoco }
    object { antebraco_direito }
    object { braco_direito }
    object { antebraco_esquerdo }
    object { braco_esquerdo }
    object { cabelo_direito }
    object { cabelo_esquerdo }
   
}