// Last edited on 2009-07-23 17:47:58 by stolfilocal
// Processed by remove-cam-lights

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

#declare raio = 2.000;

#declare tint_WALL = 
  texture {
    pigment { color rgb < 3.0, 1.6, 0.5 > / 3.0 }
    finish { diffuse 0.8  ambient 0.2 }
  }

#declare tint_ROOF= 
  texture {
    pigment { color rgb < 2.0, 0.2, 0.2 > / 2.0 }
    finish { diffuse 0.8  ambient 0.2 }
  }

#declare roleta = seed(123);

#macro fractal(n)
   #if (n=0)
     union{
       object{box{<-50,-20,-5>,<50,20,5>} texture{tint_WALL}}
       #declare counter = 10;
       #while(counter > 0)
         object{box{<-50+(counter*10),-20,-5>,<-45+(counter*10),-25,-4>} texture{tint_WALL}}
         #declare counter = counter-1; 
       #end 
     }
   #else
     union{
       #declare randomHeight = (rand(roleta)*30)+40;
       object{cylinder{<0,20,0><0,-randomHeight,0>,10} texture{tint_WALL} translate<50,0,-50>}
       object{cone{<0,-randomHeight,0>10<0,-randomHeight-30,0>,0.1} texture{tint_ROOF} translate<50,0,-50>}
       object{cylinder{<0,20,0><0,-randomHeight,0>,10} texture{tint_WALL} translate<-50,0,-50>}
       object{cone{<0,-randomHeight,0>10<0,-randomHeight-30,0>,0.1} texture{tint_ROOF} translate<-50,0,-50>}
       object{fractal(n-1) translate<0,0,50>}
       object{fractal(n-1) translate<0,0,-50>}
       object{fractal(n-1) rotate<0,90,0> translate<50,0,0>}
       object{fractal(n-1) rotate<0,90,0> translate<-50,0,0>}
       object{fractal(n-1) rotate<0,90,0> translate<-50,0,0>}
     }
   #end
#end

#declare N = 4;
union{
  fractal(N)
  rotate<0,-90,0>
}

// Original camera parameters:
// #local cam_ctr = <0,0,30>
// #local cam_vec = (<0,-250,-470>-<0,0,30>)
// #local cam_sky = y

#include "camlight.inc"
camlight(<0,-30,0>,<10,-5,10>,500.0,-y,1.0)