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

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

#declare raio = 2.000;

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

#declare tinta_B = 
  texture {
    pigment { color rgb < 1.00, 0.80, 0.10 > }
   
  }
  
#declare vermelho = 
  texture {
    pigment { color rgb < 1.00, 0.00, 0.00 > }
   
  }

#declare branco = 
  texture {
    pigment { color rgb < 1.00, 1.00, 1.00 > }
   
  }

 #declare p = 3.0/4.0;
 #declare n = 0;
 #declare r = 2;
 #macro sierp(n)

  
  #declare muro_externo =
  box { < -7, 7, 0 >, < 7, -7, 2 > 
  texture { branco }
  }
  #declare muro_interno =
  box { < -6.5, 6.5, -0.1 >, < 6.5, -6.5, 2.1 >   
  texture { branco }
  }
  #declare torre_1 = 
  cone { < -6.75, 6.75, 0 >,1 < -6.75, 6.75, 4 >, 0.5  
  texture { branco }
  }
  #declare torre_2 = 
  cone { < -6.75, 6.75, 0 >,1 < -6.75, 6.75, 4 >, 0.5 
  rotate < 0, 0, 90 > 
  texture { branco }
  }
  #declare torre_3 = 
  cone { < -6.75, 6.75, 0 >,1 < -6.75, 6.75, 4 >, 0.5 
  rotate < 0, 0, 180 > 
  texture { branco }
  }
  #declare torre_4 = 
  cone { < -6.75, 6.75, 0 >,1 < -6.75, 6.75, 4 >, 0.5 
  rotate < 0, 0, 270 > 
  texture { branco }
  }
  
  #if ( n = 0 )
  
  cone { <0, 0, 0 >, 2 < 0, 0, 8 >, 1 }
  #else
  union {
  
  cone { <0, 0, 0 >, 2 < 0, 0, 10 >, 1 }
  object { sierp(n-1)
  scale < 0.5, 0.5, 0.5>
  translate <1.5*3, 0, 0> }
  object { sierp(n-1)
  scale < 0.5, 0.5, 0.5>
  translate <-1.5*3, 0, 0> }
  object { sierp(n-1)
  scale < 0.5, 0.5, 0.5>
  translate <0, 1.5*3, 0> }
  object { sierp(n-1)
  scale < 0.5, 0.5, 0.5>
  translate <0, -1.5*3, 0> }
  
   }
  
  #end
  texture{branco}
 #end
 
#declare N = 4;

union {

   union { 
     object{sierp(N)}
     rotate <0, 0, 45>
   }

   union {

     object  { torre_1}
     object  { torre_2}
     object  { torre_3}
     object  { torre_4}
     difference {
       object { muro_externo }
       object  { muro_interno }
     }
   }
   rotate <0, 0 , 45>
 } 

// Original camera parameters:
// #local cam_ctr = <0,0,0>
// #local cam_vec = <18.00,18.00,22.00>
// #local cam_sky = z

#include "camlight.inc"
camlight(<0,0,0>,<10,7,5>,25.0,z,1.0)