// Last edited on 2009-07-22 15:29:26 by stolfilocal
// Processed by remove-cam-lights

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

global_settings{ max_trace_level 20 }

#declare raio = 2.000;

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

#declare tinta_B = 
  texture {
    pigment { color rgb < 0.20, 0.70, 0.80 > }
    finish { diffuse 0.8 ambient 0.1 }
  }
  
#declare tinta_C = 
  texture {
    pigment { color rgb < 0.20, 0.20, 0.20 > }
    finish { diffuse 0.8 ambient 0.1 }
  }

#declare tinta_V = 
  texture {
    pigment { color rgbf < 1.00, 0.90, 0.85, 0.95 > }
    finish { diffuse 0.85 ambient 0.05 }
  }

#declare tinta_M = 
  texture {
    pigment { color rgb < 0.50, 0.30, 0.0 > }
    finish { diffuse 0.9 ambient 0.1 }
  }

#declare tinta_VD = 
  texture {
    pigment { color rgb < 0.0, 0.50, 0.0 > }
    finish { diffuse 0.8 ambient 0.1 }
  }

#declare tinta_AZ = 
  texture {
    pigment { color rgb < 0.0, 0.0, 0.5 > }
    finish { diffuse 0.8 ambient 0.1 }
  }

#declare caixa1 =
box{
  <0,0,0>
  <200,100,100>
}

#declare caixa2 =
box{
  <-0.0001,-0.001,-0.001>
  <201,100.01/3,100.01/3>
  translate<0,2*100/3,2*100/3>
}

#declare caixa = 
union{
  difference{
    object{caixa1}
    object{caixa2}
  }
  texture{tinta_V}
}

#declare chao = 
plane{
 <0,0,1>, 0
 texture{tinta_M}
}

#macro funcao(n)
  #if(n=0)
    object{caixa }
  #else
    union{
      #declare i=0;
      #while(i<3)
        object{ funcao(n-1) translate<0,0,0>}
        object{ funcao(n-1) translate<0,100,0>}
        object{ funcao(n-1) translate<0,200,0>}
        object{ funcao(n-1) translate<0,0,100>}
        object{ funcao(n-1) translate<0,100,100>}
        object{ funcao(n-1) translate<0,200,100>}
        object{ funcao(n-1) translate<0,0,200>}
        object{ funcao(n-1) translate<0,100,200>} 
        #declare i=i+1;
      #end
      scale<1/3,1/3,1/3>
      // color rgbf<1,0,0,n/3>
      // color rgb<0.5,0.5,0.17*n>
    }
  #end
#end

union{
  object{caixa}
  //object{chao}
  funcao(2)
}

// Original camera parameters:
// #local cam_ctr = <40,20.00,50.00>
// #local cam_vec = (<250.00,250.00,250.00>-<40,20.00,50.00>)
// #local cam_sky = z

#include "camlight.inc"
camlight(<100,20.00,50.00>,<10,10,10>,400.0,z,1.0)