// Last edited on 2009-07-22 14:39:29 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.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }

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

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

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

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

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

#declare roleta = seed(333);
#declare loops = 11;
#while(loops > 0)

   
   #declare shelfWidth = (rand(roleta)*60)+30;

   
   #declare shelfHeight = (rand(roleta)*300)+60;

   
   box{
     <positionX,0,0>,
     <positionX,15,shelfHeight>
     texture { tinta_D }
  }

  
  box{
     <positionX+shelfWidth,0,0>,
     <positionX+shelfWidth,15,shelfHeight>
     texture { tinta_D }
  }

  #declare numShelfs = (rand(roleta)*7)+1;
  #declare counter = numShelfs; 

  
  #while(counter > 0)
          #declare tempY = (shelfHeight/numShelfs)*counter;
   box{
      <positionX,0, tempY>,
      <positionX+shelfWidth,15,tempY+3> 
      texture { tinta_D }
   }

          
          #declare numObjects = (rand(roleta)*3)+2;
          #declare counter2 = numObjects-2;
          #while(counter2 > 0)
              #declare objectType = int((rand(roleta)*4));
       #declare tempX = shelfWidth/numObjects;

              
              #if(objectType = 0)
               box{
       <positionX+(tempX*counter2)+10,5, tempY+3>,
       <positionX+(tempX*counter2)+16,8,tempY+8>
       texture { tinta_A }
    }
              #end

              
              #if(objectType = 1)
               sphere{
       <positionX+(tempX*counter2)+10,5, tempY+6>,3
       texture { tinta_B }
    }
              #end

              
      #if(objectType = 2)
               cylinder{
       <positionX+(tempX*counter2)+10,5, tempY+6>,
                <positionX+(tempX*counter2)+10,5, tempY+3>,6
       texture { tinta_C }
    }
              #end

        #if(objectType = 3)
               cone{
       <positionX+(tempX*counter2)+10,5, tempY+3>,6
                <positionX+(tempX*counter2)+10,5, tempY+8>,3
       texture { tinta_E }
    }
              #end

          #declare counter2 = counter2 -1;
          #end
          

  #declare counter = counter-1;
  #end 

  #declare positionX = positionX+shelfWidth;
  
  #declare loops = loops -1;
#end

// Original camera parameters:
// #local cam_ctr = <280,0,50>
// #local cam_vec = (<0,-750,100>-<280,0,50>)
// #local cam_sky = z

#include "camlight.inc"
camlight(<500,0,220>,<10,10,5>,600.0,z,1.0)