// MC930 - Laboratorio 4
// Martim Carbone - RA:002193

#include "colors.inc"

light_source { <0, 0, 5> color rgb <1, 1, 1>}
light_source { <-12, 12, 5> color rgb <1, 1, 1>}
light_source { <8, 8, 20> color rgb <1, 1, 1>}
light_source { <-8, -8, 20> color rgb <1, 1, 1>}

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

#if(clock<0.6)
  #declare cor_roda=Black;
#else
  #declare cor_roda=White;
#end
  

#if(clock<0.6)
  #declare t1 = (clock-0.0)/(0.6-0.0);
  #declare pos_camera = ((1-t1)*<0,-10,1.5>)+(t1*<3.5,-3,-0.25>);
#else
  #declare pos_camera = <3.5,-3,-0.25>;
#end
  
#declare texto = 
  text {
    ttf "arial.ttf"
    "FOME ZERO"
    0.15, 0
  }

#declare carro = 
  difference {
    box {
      <4, 2, 0>
      <-4, -2, 3>
    }
    box {
      <-5,-3, 1.5>
      <5, 3, 6>
      rotate 20*y
    }
  }

#declare roda = 
  cylinder {
    <0,0,0>, <0,0,0.2>,0.5
  }

camera {
  location  pos_camera
  look_at   <3.5, -2,-0.25 >
  sky <0,0,1>
} 

  
object{
  carro
  texture{ pigment { color rgb Red }}
}
object{
  roda
  rotate 90*x
  translate <3.5, 2, -0.25>
}
object{
  roda
  rotate 90*x
  translate <-3.5, 2, -0.25>

}
object{
  roda
  rotate 90*x
  translate <3.5, -2, -0.25>
  texture{ pigment{cor_roda}}
}
object{
  roda
  rotate 90*x
  translate <-3.5, -2, -0.25>
}

//#if(clock>=0.6)
  object{
    texto
    translate <3.5, -2.3, -0.25>
    texture {pigment{ color Black}}
//    scale <1,0.5,0.5>
  }
//#end