/*#include "textures.inc"
#include "colors.inc"    // The include files contain
#include "stones.inc"    // pre-defined scene elements
#include "metals.inc"
#include "woods.inc"
#include "finish.inc"
#include "shapes.inc"
#include "skies.inc"
#include "chars.inc"
#include "stars.inc"
#include "/home/ec2000/ra002808/mc930/coisas/robot666_v20.inc"
*/
camera {
 location < 0,8,30 >  // Posição do observador.
// location < 0,3800,40>  //de cima
 //location <15,90,30> //de lado
// location <-50,150,0>   //outro lado
 //location <5,5,-35> //atras
 //location <5,-30,-5> //de baixo
  //right     -1.0*x                 // Largura RELATIVA da imagem.
  //up        0.75*y                 // Altura RELATIVA da imagem.      
  sky       y                      // Qual direção é "para cima"?
  look_at   <0, 3, 0 >  // Para ond e 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 * < -20.0, +20.0, +20.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, -10.0, +10.0 >             // Posição da lâmpada.
 // color rgb 0.8 * < 1.00, 1.00, 1.00 >   // Intensidade e corda luz.
//} 

// ======================================================================
// DESCRIÇÃO DA CENA 
sky_sphere { pigment {color rgb < 0.25, 0.22, 0.45 >} }
//sky_sphere { pigment {checker color rgb < 0.3, 0.3, 0.3 > color rgb <0.7,0.7,0.7>} }


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



#declare sup_transp=
  texture{
     finish {
       ambient 0.1
       diffuse 0.1
       roughness 0.001
       reflection 0.25
       specular 1
     
     }
      
      pigment {color rgb <0.9,0.9,0.9> filter 1  } 
  }  
  //interior {ior 1.5}
  
#declare sup_metalica =
   texture {
      finish{
        ambient 0.05
	diffuse 0.05
	reflection color rgb <1,1,0.0>
	specular 0.20
	roughness 0.05
    }   
    
   }  
 
#declare sup_metalica2 =
   texture {
      finish{
        ambient 0.05
	diffuse 0.05
	reflection color rgb <1.0,0.8,0.7>
	specular 0.20
	roughness 0.05
    }   
    
   }      

//animacao
#declare rel=(clock-0.25)/(1-0.25);
#declare clck1=(0+clock)/(0.5-0);
#declare clck2=(clock-0.5)/(1-0.5);
#declare relport=(clock-0.85)/(1-0.85);

#if (clock<=0.5)
   #declare xcar1=(1-clck1)*0+clck1*-16;
   #declare zcar1=(1-clck1)*-40+clck1*0;
   #declare xcar2=(1-clck1)*0+clck1*12;
   #declare zcar2=(1-clck1)*-40+clck1*0;
   #declare rotcar1=0;
   #declare rotcar2=0;
 #else
   #declare xcar1=(1-clck2)*-16+clck2*-16;
   #declare zcar1=0;//(1-clck2)*0+clck2*0;
   #declare xcar2=(1-clck2)*12+clck2*12;
   #declare zcar2=0;//(1-clck2)*0+clck2*0;
   #declare rotcar1=270*clck2;
   #declare rotcar2=-270*clck2;
#end

#if (clock>=0.85)
   #declare port1=(1-relport)*0+relport*-120;
   #declare port2=(1-relport)*0+relport*120;
 #else 
   #declare port1=0;
   #declare port2=0;
#end   


/////   
   
   
   
#declare carroceria =
    box{
      <0,0,0>,
      <6,1,2>
      pigment {color rgb <0.2,0.2,0.2>}
    
    }   
   
#declare roda =
      torus {
         0.8,0.3
	 pigment {checker color rgb < 0.3, 0.3, 0.3 > color rgb <0.7,0.7,0.7> scale 0.2}
         rotate x*90
	 rotate z*rel*360*8
	 translate y*0.5
      }    

#declare carro =
  union{
     object {carroceria translate y*0.3}
     object {roda translate <1,0.45,0>}
     object {roda translate <1,0.45,2>}
     object {roda translate <4,0.45,0>}
     object {roda translate <4,0.45,2>}
     /*translate*/ rotate y*-90 
  }      
      
#declare texto =
  text{
    ttf "arial.ttf"
    "Formula Zero"
    0.10,0
    scale 1.5
    rotate y*180
    //rotate x*-90
    translate <4.5,1,-120>
    pigment {color rgb <1.0,0.9,0.9>}
  } 
  
//#if (clock>=0.0)&&(clock<0.5)
//   #declare varx =   
      
/*#declare corrida =
     object {carro translate <-16,0,0> rotate clock*y*-360} 
     object {carro translate <12,0,0> rotate clock*y*360} 
     //object {texto scale 3*clock}
*/
#declare corrida =
     object {carro translate <xcar1,0,zcar1> rotate rotcar1*y} 
     object {carro translate <xcar2,0,zcar2> rotate rotcar2*y} 
     //object {texto scale 3*clock}


#declare piramide =
   prism{
     conic_sweep
     linear_spline
     0+clock*0.5,1,4
     <-1,1>,<1,1>,<1,-1>,<-1,-1>    
     pigment {gradient y}    
     rotate x*180
     translate<0,1,0>
     scale <4,6,4>
   }
     
 
#declare trofeu =
   lathe{
     quadratic_spline
     15
     <0,0>,<0.8,0>,<0.6,0.3>,<0.5,1.0>,<0.7,1.2>,
     <1,1.4>,<1.2,1.5>,<1,1.8>,<0.7,2.5>,
     <0.6,2.5>
     <0.9,1.4>,<1.1,1.5>,<0.9,1.8>,<0.6,2.5>
     <0,2.4>
      texture {sup_metalica}
      interior {ior 1.5}
      //translate y*-2
      scale 3*clock
      
   
   }
/**/
//bandeiras

#declare mastro=
   cylinder {
       <0,0,0>
       <0,10,0>
       0.2   
      pigment {color rgb <1,1,1>}
   }

#declare tecido =
     box {
        <0,0,0>
        <5,3,1>
	translate z*-0.5
	pigment {checker color rgb < 1, 0, 0 > color rgb <0,0,0> scale 0.2}
	
     }   

#declare  bandeira =
   union{
      object {mastro}
      object {tecido translate y*7}   
   }   

/**/   


#declare coluna =
    lathe{
      quadratic_spline
      13
      <0,0>,<1,0><0.75,0.5><0.6,1>,<0.6,3>,
      <0.6,4>,<0.7,4.5><1,4.75><0.7,5.0>,<1,5.25>,
      <0.7,5.5>,<1,6><0,5.6>
      pigment {color rgb <0.2,0.2,0.2>}
      scale 2
    }

#declare portao =
     prism{
      0,0.6,4
      <0,0>,<4,0>,<4,5>,<0,3>
     pigment {gradient x}    
     scale 2
     //scale x*2
     rotate x*-90
     //rotate y*120
     }
 
#declare entrada=
     union{
        object {coluna}
	object {portao rotate y*180 translate <-0.7,2,-0.6>}
     }     

     
                
           
#declare chao= 
  plane {
    <0,1,0>, 0
    //pigment {checker color rgb < 0.3, 0.3, 0.3 > color rgb <0.7,0.7,0.7> scale 2}
    rotate y*30
        //texture {T_Stone_23}
    pigment {color <0.3,0.7,0.0>}
  } 
  
  object {texto translate <0,10*clock, 135*clock>}
  object {piramide rotate y*360*clock}
  object {trofeu translate y*3*clock*0.85}
  object {chao}
#if (clock>=0.9) 
   #declare band=(clock-0.9)/(1-0.9);
  object {bandeira rotate z*-30 translate < (1-band)*20+band*1,band*3,15>}
  object {bandeira rotate y*180 rotate z*30 translate < (1-band)*-20+band*-1,band*3,15>}
#end   
  object {corrida}
  //object {coluna} 
  object {entrada rotate y*120 rotate y*port1 translate <8.8,0,12>}
  object {entrada rotate y*60  rotate y*port2 translate <-8.8,0,12>}