// Last edited on 2003-11-26 17:43:39 by stolfi
// LAB-04  -- 18/Set/2003
// ANIMACOES!!



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

#declare ctr = <  0.00, 0.00, 0.00 >;
#declare camdir = <  0.00, 0.00, 25.00 >;

camera {
  location ctr + 1.00*camdir
  right    -1.00*x
  up       0.75*y
  sky      z
  look_at  ctr
} 

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

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

light_source {
  10 * < -30.0, 0.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 

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

#declare raio = 2.000;

// ======================================================================
// CORES USADAS
// ======================================================================
 
#declare bgcolor =
  texture {
    pigment { color rgb < 0.75, 0.80, 0.85 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

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

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

#declare preto = 
  texture {
    pigment { color rgb < 0.00, 0.00, 0.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

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

// ======================================================================
// Cristais e Espelhos
// ======================================================================

#declare cor_cristal =  < 0.00, 0.00, 0.70 >;
#declare tx_cristal =
  texture {
    finish { ambient 0.1 diffuse 0.1 reflection 0.25 specular 1.0 roughness 0.001 }
    pigment { color cor_cristal filter 1 }
  }


#declare cor_espelho = < 0.5, 0.5, 0.5 >;
#declare tx_espelho = 
  texture {
    pigment { rgb cor_espelho }
    finish { ambient 0.05 diffuse 0.05 reflection cor_espelho specular 0.20 roughness 0.05  }
  }



// ======================================================================
// FORMAS USADAS
// ======================================================================


#declare chao = 
  plane { <0, 0, 1>, -10
          texture {laranja}
	}

#declare chao2 = 
  plane { <0, 0, 1>, -10
          texture {branco}
	}

#declare chao3 = 
  plane { <0, 0, 0.5>, -10
          texture {branco}
	}


#declare grande =
  sphere {
    <0.00, 0.00, 0.00>, 30.00
    texture {branco}
    translate <0, 0, 4>
  }

#declare pequena =
  sphere {
    <0.00, 20.00, -15.00>, 15.00
    texture {branco}
    translate <0, 0, 4>
  }

#declare haste_base =
  difference { 
	object {pequena}
	object {grande}
	}  

#declare haste2 = 
  difference {
        object {haste_base}
        object {chao2}
	}

#declare haste =
  difference {
        object {haste2}
        object {chao3}
	rotate -90*y
	}


#declare torre =
  cylinder {
	<0.00, 0.00, +0.00>,
	<0.00, 0.00, +35.0>,
	5.0
	texture {tx_cristal}
	}

#declare toro =
  torus { 20, 5
	 texture {tx_espelho}
	 rotate 90*x
	}

// ======================================================================
// LAB04 - Itens Especificos
// ======================================================================

#declare p1 = <  0, 0 ,0>;
#declare p2 = <-10, 0, 0>;
#declare p3 = <+10, 0, 0>;
#declare p4 = <  0,-10,0>;
#declare p5 = <  0,+10,0>;

#declare time1 = (clock - 0.0)/(0.2 - 0.0);
#declare time2 = (clock - 0.2)/(0.4 - 0.2);
#declare time3 = (clock - 0.4)/(0.6 - 0.4);
#declare time4 = (clock - 0.6)/(0.8 - 0.6);
#declare time5 = (clock - 0.8)/(1.0 - 0.8);

#declare Texto1 =
   text { ttf "ariblk"
	"Ajude voce tambem"
	0.10, 0
	texture {branco}
	}

#declare Texto2 =
   text { ttf "ariblk"
	"O FOME ZERO"
	0.10, 0
	texture {branco}
	}

#declare Texto3 =
   text { ttf "ariblk"
	"Venha para Interlagos"
	0.10, 0
	texture {tx_cristal}
	}

#declare Texto4 =
   text { ttf "ariblk"
	"10% da renda da corrida"
	0.10, 0
	texture {branco}
	}

#declare Texto5 =
   text { ttf "ariblk"
	"sera destinada ao programa"
	0.10, 0
	texture {branco}
	}




// ======================================================================
// CENA!
// ======================================================================

// object {chao}
//
// object {haste translate <0,-5,0> rotate -45*z}
// object {haste translate <0,-5,0> rotate +45*z}
// object {haste translate <0,-5,0> rotate -135*z}
// object {haste translate <0,-5,0> rotate +135*z}
// 
// object {torre translate <0,0,-10>}
//
// object {toro translate <0,0,-5>}

object {Texto1 translate <-10+time1, +5, 0>}
object {Texto2 translate <-2*time2, +3, 0>}
object {Texto3 translate <-5.5, 7-time3*2, 0>}
object {Texto4 translate <-5.5, -5+time4*1.5, 0>}
object {Texto5 translate <-7.5, -5+time5*1.5, 0>}