// Last edited on 2009-07-22 17:30:22 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 < 1.00, 0.20, 0.20 > }
    finish { diffuse 0.9 ambient 0.1 }
  }

#declare tinta_B = 
  texture {
    pigment { color rgb < 0.20, 0.20, 1.00 > }
    finish { diffuse 0.9 ambient 0.1 }
  }

#declare tinta_C = 
  texture {
    pigment { color rgb < 0.20, 1.00, 0.20 > }
    finish { diffuse 0.9 ambient 0.1 }
  }

#declare tinta_D = 
  texture {
    pigment { color rgb < 1.00, 0.20, 0.20 > }
    finish { diffuse 0.9 ambient 0.1 }
  }

#declare tinta_E = 
  texture {
    pigment { color rgb < 0.20, 0.20, 0.20 > }
    finish { diffuse 0.9 ambient 0.1 }
  }

#declare positionX = 20;
#declare shelfWidth = 100;
#declare shelfHeight = 10;

#declare sFac = 0.5;
#declare tFac= 50.0;

#macro fractal(n, rotation, px, pz, width2)

  // ??? - parametro 'rotation' não é usado! -- JS

  #if (n=0)
      
    union{
      sphere{
        <px,0,pz>,width2
         texture { tinta_B }
      }
      sphere{
         <px+width2*1.5,0,pz>,30 
          texture { tinta_B }
       }
       sphere{
         <px-width2*1.5,0,pz>,30
          texture { tinta_B }
       }
    }       
     
  #else
    union{
      object { fractal(n-1, rotation, px+width2*2*sFac, pz, width2*sFac) scale<sFac,sFac,sFac>} 
      object { fractal(n-1, rotation, px-width2*2*sFac, pz, width2*sFac) scale<sFac,sFac,sFac>}
      object { fractal(n-1, rotation, px, pz+width2*2*sFac, width2*sFac) rotate<0,90,0> scale<sFac,sFac,sFac>}
      object { fractal(n-1, rotation, px, pz-width2*2*sFac, width2*sFac) rotate<0,90,0> scale<sFac,sFac,sFac>}
    }
  #end
  #declare tFac = tFac * 0.8;
#end

#declare N = 5;

fractal(N,-1,0,0,3000)

// Original camera parameters:
// #local cam_ctr = <0,0,30>
// #local cam_vec = (<0,-600,0>-<0,0,30>)
// #local cam_sky = z

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