// MC930 - Projeto Final
// Last edited on 2000-12-14 09:07:40 by Fabio Yuasa Niizu RA:962325

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

#declare i=1;
#declare j=0;

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

light_source {
  < 0.00, -1000.00, 1000.00 >
  color rgb < 1.00, 1.00, 1.00 >
}

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

#declare tinta_rodovia =
  texture {
    pigment { color rgb < 1, 1, 1 > }
    finish { diffuse 0.2 specular 0.05 roughness 0.005 ambient 0.1 }
  }

#declare tinta_white =
  texture {
    pigment { color rgb < 1, 1, 1 > }
    finish { diffuse 0.9 specular 0.9 roughness 0.005 ambient 0.1 }
  }

// Corpo


// Central

#declare parte_inferior =
  box {
    < -50.00, -5.00, 10.00>,  // Near lower left corner
    < 50.00, 5.00,  11.50>
    texture { tinta_white }
  }

#declare vidro_do_meio =
  box {
    < -50.00, -5.00, 11.50>,  // Near lower left corner
    < 50.00, 5.00,  13.50>
    texture { NBglass }
  }

#declare parte_superior =
  box {
    < -50.00, -5.00, 13.50>,  // Near lower left corner
    < 50.00, 5.00,  15.00>
    texture { tinta_white }
  }

#declare parte_central =
  box {
    < -14.00, -9.00, 10.00>,  // Near lower left corner
    < 14.00, 9.00,  11.50>
    texture { tinta_white }
  }

#declare vidro_central =
  box {
    < -14.00, -9.00, 11.50>,  // Near lower left corner
    < 14.00, 9.00,  14.00>
    texture { NBglass }
  }

//Piso inferior

#declare sup_piso_inferior =
  box {
    < -50.00, -5.00, 9.00>,  // Near lower left corner
    < 14.00, 5.00,  10.0>
    texture { tinta_white }
  }

#declare vidro_piso_inferior =
  box {
    < -50.00, -5.00, 10.00>,  // Near lower left corner
    < 14.00, 5.00,  8.00>
    texture { NBglass }
  }

#declare inferior_piso_inferior =
  box {
    < -50.00, -5.00, 8.00>,  // Near lower left corner
    < 14.00, 5.00,  6.50>
    texture { tinta_white }
  }

// Pilares

#declare pilar_esquerdo =
  box {
    < -31.00, -5.00, 0.00>,  // Near lower left corner
    < -32.00, 5.00,  7.0>
    texture { tinta_white }
  }

#declare pilar_direito =
  box {
    < 31.00, -5.00, 0.00>,  // Near lower left corner
    < 32.00, 5.00,  10.0>
    texture { tinta_white }
  }

// Telhados

#declare telhado_central_inf =
  prism {
    conic_sweep
    linear_spline
    0, // height 1
    1, // height 2
    5, // the number of points making up the shape...
    <4,4>,<-4,4>,<-4,-4>,<4,-4>,<4,4>
    rotate < -90, 0, 0 >
    translate < 0.00, 1.50, 1.8 >
    scale < 4.0, 4.0, 17.0 >
    pigment { color White }
  }

#declare telhado_central_sup =
  prism {
    conic_sweep
    linear_spline
    0, // height 1
    1, // height 2
    5, // the number of points making up the shape...
    <4,4>,<-4,4>,<-4,-4>,<4,-4>,<4,4>
    rotate < -90, 0, 0 >
    translate < 0.00, 1.50, 1.85 >
    scale < 4.0, 4.0, 17.0 >
    pigment { color White }
  }

//PAVIMENTO

#declare pavimento = 
  plane{ z, 0
    texture{ 
      pigment{
        color rgb < 0.0, 1.0, 0.0 >
      }
      finish{ diffuse 0.9 ambient 0.05 specular 0.3 roughness 0.1 }
      normal{ granite 0.5 }
    }
   scale 10
  }

//Rodovia

#declare estrada_interior =
  
  box {
    < -30.50, -200.00, 0.00>,  // Near lower left corner
    < -5.50, 2000.00,  0.05>
    texture { tinta_rodovia }
  }

#declare estrada_capital =
  
  box {
    < 5.5, -200.00, 0.00>,  // Near lower left corner
    < 30.50, 2000.00,  0.05>
    texture { tinta_rodovia }
  }

#declare risco_longo1 =
  
  box {
    < -29.95, -200.00, 0.00>,  // Near lower left corner
    < -30.05, 2000.00,  0.06>
    texture { tinta_white }
  }

#declare risco_longo2 =
  
  box {
    < -5.95, -200.00, 0.00>,  // Near lower left corner
    < -6.05, 2000.00,  0.06>
    texture { tinta_white }
  }

#declare risco_longo3 =
  
  box {
    < 5.95, -200.00, 0.00>,  // Near lower left corner
    < 6.05, 2000.00,  0.06>
    texture { tinta_white }
  }

#declare risco_longo4 =
  
  box {
    < 29.95, -200.00, 0.00>,  // Near lower left corner
    < 30.05, 2000.00,  0.06>
    texture { tinta_white }
  }


#declare risco =
  
  box {
    < -21.95, -200.00, 0.00>,  // Near lower left corner
    < -22.05, -198.00,  0.06>
    texture { tinta_white }
  }

#while (i < 2000)
    #declare j = j + 5;   
    object { risco
             translate <0,j,0> }
    #declare i = i + 1;
#end

#declare i=1;
#declare j=0;

#while (i < 200)
    #declare j = j + 5;   
    object { risco
             translate <8,j,0> }
    #declare i = i + 1;
#end

#declare i=1;
#declare j=0;

#while (i < 200)
    #declare j = j + 5;   
    object { risco
             translate <36,j,0> }
    #declare i = i + 1;
#end

#declare i=1;
#declare j=0;

#while (i < 200)
    #declare j = j + 5;   
    object { risco
             translate <44,j,0> }
    #declare i = i + 1;
#end

//ceu
  plane { -z, -1100
    texture {
      pigment {SkyBlue}
      finish { ambient 1 diffuse 0}
     }
     texture {
       pigment {
         bozo
         turbulence .5
         color_map {
           [0 White]
           [1 White filter 1]
         }
       }
       finish { ambient 1 diffuse 0 }
       scale <30000, 7500, 7500>
       rotate <5, 45, 0>
    }
}

// CENA

object {parte_inferior}
object {telhado_central_inf}
object {sup_piso_inferior}
object {vidro_piso_inferior}
object {inferior_piso_inferior}
object {telhado_central_sup}
object {vidro_central}
object {parte_central}
object {vidro_do_meio}
object {pavimento}
object {parte_superior}
object {estrada_interior}
object {estrada_capital}
object {pilar_esquerdo}
object {pilar_direito}
object {risco_longo1}
object {risco_longo2}
object {risco_longo3}
object {risco_longo4}