// Last edited on 2009-07-22 13:13:00 by stolfilocal
// Processed by remove-cam-lights

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

#declare raio = 2.000;

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

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

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

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

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

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

#declare preto = 
  texture {
    pigment { color rgb < 0.00, 0.00, 0.00 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }

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

#declare marron = 
  texture {
    pigment { color rgb < 0.81, 0.42, 0.30 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }

#declare base_estantes =
      box {
 < 2.00, 2.00, 0.00 >,
 < 3.70, 7.00, 8.20 >
        texture { marron }
      }

#declare furo_estantes =
  union{
    #declare i = 0;
    #while(i < 4)
      box {
        < 2.20, 2.20, 0.20 + 2*i >,
        < 4.00, 6.80, 2.00 + 2*i >
        texture { marron }
      }
      #declare i = i+1;
    #end
  }

#declare estante = 
  difference{
    object{base_estantes}
    object{furo_estantes}
  }

 #declare roleta = seed(412);

   union{
     #declare n_estantes = 5;
     #while (n_estantes > 0)
       #declare tabuinha =

         union{
           #declare pos_z = 0;
           #while(pos_z < 4)

             #declare pos_y = 0; 
             #while(pos_y < 3)

               #declare nrand = int(rand(roleta)*4);
               #if(nrand = 0)
                 box {
                   < 2.25, 3.5 + pos_y, 0.20 + pos_z*2 >,
                   < 2.75, 4.0 + pos_y, 0.70 + pos_z*2 >
    
                   texture { cinza }
                 }
               #end
               #if(nrand = 1)
                 cylinder {
                 < 3.00, 3.5 + pos_y, 0.20 + pos_z*2 >,
                 < 3.00, 3.5 + pos_y, 0.95 + pos_z*2 >, 0.3
     
                 texture { azul }
                 }
               #end
               #if(nrand = 2)
                 sphere {
                 < 2.55, 3.5 + pos_y, 0.70 + pos_z*2  >, 0.3
               
                 texture { vermelho }
               }
               #end
               #if(nrand = 3)
                 cone {
                   <2.55, 3.5 + pos_y, 0.20 + pos_z*2 >, 0.3
                   <2.55, 3.5 + pos_y, 0.95 + pos_z*2 >, 0.01
    
                   texture { amarelo }
                 }
               #end
               #declare pos_y = pos_y + 1;
             #end
             #declare pos_z = pos_z + 1;
           #end
         }

      object { estante translate<n_estantes*4,0,0>}

      object { tabuinha translate<n_estantes*4,0,0>}  
 
      #declare n_estantes = n_estantes - 1;
    #end
  }
  

// Original camera parameters:
// #local cam_ctr = <15.00,5.00,0.00>
// #local cam_vec = (<30.00,-10.00,12.00>-<15.00,5.00,0.00>)
// #local cam_sky = z

#include "camlight.inc"
camlight(<15.00,3.00,3.00>,<10,-7,6>,30.0,z,1.0)