#macro rain(rwidth,rheight,rdepth,rrad,avglength,rotation,translation,num)

  #local S = seed(21850);
  
  #local cnt = 0;

  union{
  
  #while ( cnt < num )
  
    #local len = .3*avglength*(rand(S)+.1*rand(S))+.7*avglength;
    
    sphere{ <0,0,0>, rrad scale <1,len/rrad,1>
      rotate rotation*z
      translate ((rand(S)+.1*rand(S)+.01*rand(S)+.001*rand(S))-.5)*rwidth*x  
      translate ((rand(S)+.1*rand(S)+.01*rand(S)+.001*rand(S))-.5)*rheight*y
      translate (rand(S)+.1*rand(S)+.01*rand(S)+.001*rand(S))*rdepth*z
      translate translation
      texture{ 
        pigment{ color rgbt <1.4,1.4,1.4,.85> }
        finish{ ambient .6 diffuse .9 }
        }
      }
      
    #local cnt = cnt + 1;
    
  #end
  
  }
  
#end