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

#include "colors.inc"

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

#declare altura = 2.0;
#declare largura = 8.0;

#declare escala = 1/2;

#declare textura_marble =
pigment {
    marble
    turbulence 1
    color_map {
      [0.0 color White] 
      [0.7 color Gray90] 
      [1.0 color Gray70] 
    }
    scale 0.2
}

#declare muralha =
box { <-4.0, 0.0, -4.0> , < 4.0, 2.0, -4.5> }

#declare torre = 
cylinder { < -4.5, 0.0, -4.5 >, < -4.5, 2.0, -4.5 >, 0.5}

#declare base =
box { < -4.0, 0.0, -4.0 >, < 4.0, 0.1, 4.0 > }

#macro geraCastelo ( num_iteracoes )
  #if ( num_iteracoes = 0 )
    union{
      object{ muralha }
      object{ muralha rotate < 0, 90, 0 > }
      object{ muralha rotate < 0, 180, 0 > }
      object{ muralha rotate < 0, 270, 0 > }
      object{ torre }
      object{ torre rotate < 0, 90, 0 > }
      object{ torre rotate < 0, 180, 0 > }
      object{ torre rotate < 0, 270, 0 > }
      object{ base }
    }
  #else
    union{
      object{ muralha }
      object{ muralha rotate < 0, 90, 0 > }
      object{ muralha rotate < 0, 180, 0 > }
      object{ muralha rotate < 0, 270, 0 > }
      object{ torre }
      object{ torre rotate < 0, 90, 0 > }
      object{ torre rotate < 0, 180, 0 > }
      object{ torre rotate < 0, 270, 0 > }
      object{ base }
      union{
 object{ geraCastelo(num_iteracoes-1) translate < -largura, altura*2, -largura >}
 object{ geraCastelo(num_iteracoes-1) translate < largura, altura*2, -largura > }
 object{ geraCastelo(num_iteracoes-1) translate < -largura, altura*2, largura > }
 object{ geraCastelo(num_iteracoes-1) translate < largura, altura*2, largura > }
 scale < escala, escala, escala >
      }
    }
  #end
#end

object { geraCastelo(2) texture { textura_marble } }

// Original camera parameters:
// #local cam_ctr = <0.00,4.00,0.00>
// #local cam_vec = (<20.00,10.00,-20.00>-<0.00,4.00,0.00>)
// #local cam_sky = y

#include "camlight.inc"
camlight(<1.50,4.00,1.50>,<10,5,7>,20.0,y,1.0)