// Last edited on 2005-01-06 01:31:59 by stolfi
// Processed by remove-cam-lights

#declare gerador = seed (123456);

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

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

#declare cor_cristal_azul = < 0.5, 0.5, 1.5>;
#declare tx_cristal_azul =
  texture {
    finish {
 ambient 0.1 diffuse 0.1 reflection 0.25
 specular 1 roughness 0.001
 }
    pigment { color cor_cristal_azul filter 1 }
  }

#declare cor_cristal_outro = < 0.5, 1.5, 1.5>;
#declare tx_cristal_outro =
  texture {
    finish {
 ambient 0.1 diffuse 0.1 reflection 0.25
 specular 1 roughness 0.001
 }
    pigment { color cor_cristal_outro filter 1 }
  }

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

#declare cor_interna =
  texture {
    pigment { color rgb < 0.60, 0.80, 0.10 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 }
  }

#declare plano =
 plane {
   z,-2
          texture {

  pigment { checker <0.2,0.1,0.1>, <0.3,0.3,0.5> }
  finish { ambient 0.1 diffuse 0.9 }
  scale 1.5

   }
 }

#declare janela =
 box {
   <-1,-1,-0.05>
   <1,1,0.05>
   texture { tx_cristal_azul }
   interior { ior 1.2 }
 }

#declare janela_grande =
 box {
   <-1,-2,-0.05>
   <1,2,0.05>
   texture { tx_cristal_azul }
   interior { ior 1.2 }
 }

#declare sala =
 union {
    difference {
     box {
  <-2,-4,-2>
  <2,4,2>
  texture { cor_sala }
     }
     union {
       box {
  <-3,-2,-1>
  <3,2,1>
  texture { cor_interna }
       }
       box {
  <-1,-5,-1>
  <1,5,1>
  texture { cor_interna }
       }
     }
   }
   object { janela rotate 90*x translate <0,-4,0> }
   object { janela rotate 90*x translate <0,4,0> }
   object { janela_grande rotate 90*y translate <2,0,0> }
   object { janela_grande rotate 90*y translate <-2,0,0> }
 }

#declare fileira_terreo =
 union {
   #declare i=0;
   #while (i<5)
 union {
     box {
  <-2,-4,-2>
  <2,4,2>
  texture { cor_sala }
  translate <-4,0,0>
     }
    difference {
     box {
  <-2,-4,-2>
  <2,4,2>
  texture { cor_sala }
     }
     union {
       box {
  <-3,-2,-1>
  <3,2,1>
  texture { cor_sala }
       }
       box {
  <-1,-5,-1>
  <1,5,1>
  texture { cor_sala }
       }
     }
   }
   #if (rand(gerador)>0.5)
  object { janela rotate 90*x translate <0,-4,0> }
   #end
   #if (rand(gerador)>0.5)
  object { janela rotate 90*x translate <0,4,0> }
   #end
   #if (rand(gerador)>0.5)
  object { janela_grande rotate 90*y translate <2,0,0> }
   #end
   #if (rand(gerador)>0.5)
  object { janela_grande rotate 90*y translate <-2,0,0> }
   #end
   translate <-8*i,0,0>
 }
  #declare i=i+1;
   #end
 }

#declare andar_superior =
 union {
   #declare k=0;
   #while (k<3)

 union {
   #declare i=0;
   #while (i<10)

 union {
    difference {
     box {
  <-2,-4,-2>
  <2,4,2>
  texture { cor_sala }
     }
     union {
       box {
  <-3,-2,-1>
  <3,2,1>
  texture { cor_sala }
       }
       box {
  <-1,-5,-1>
  <1,5,1>
  texture { cor_sala }
       }
     }
   }
   #if (rand(gerador)>0.5)
  object { janela rotate 90*x translate <0,-4,0> }
   #end
   #if (rand(gerador)>0.5)
  object { janela rotate 90*x translate <0,4,0> }
   #end
   #if (rand(gerador)>0.5)
  object { janela_grande rotate 90*y translate <2,0,0> }
   #end
   #if (rand(gerador)>0.5)
  object { janela_grande rotate 90*y translate <-2,0,0> }
   #end
   translate <-4*i,0,0>
 }
  #declare i=i+1;
   #end
   translate <0,8*k,0>
 }
  #declare k=k+1;
   #end
 }

#declare bloco_superior =
 union {
   #declare i=0;
   #while (i<3)
  object { andar_superior translate <0,0,4*i> }
  #declare i=i+1;
   #end
 }

#declare terreo =
 union {
   object { fileira_terreo translate <0,0,0> }

 }

#declare porta =
 box {
   <-2,-4,-0.05>
   <2,4,0.05>
   texture { tx_espelho }

 }

#declare teto =
 box {
  <-20,-12,0>
  <20,12,1>
  texture { pigment {color rgb < 0.30, 0.40, 0.20 > } }
 }

union {
object { plano }
object { bloco_superior translate <0,0,4>}
object { fileira_terreo }
object { fileira_terreo translate <0,16,0>}
object { porta rotate 90*y translate <2,8,0> }
object { porta rotate 90*y translate <-40,8,0> }
object { teto translate <-18,8,14>}
translate <10,0,0>

}

#include "camlight.inc"
camlight(<0,0,5>,<24,-30,15>,1.10,z,1.0)