noise
eharetea

An attempt to re-create the noise() expression.

Noise!

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Friday August 01st, 2008 01:22 PM

dnoise(float v)
{

   float left=floor(v);
   float right=ceil(v);

   #percentage of the way through the chunk

   float perc = v - floor(v);
   if (left == 0) perc = v - int(v);



   float rleft=rand(left);
   float rright=rand(right);

   perc = 3 * perc * perc - 2 * perc * perc * perc;

   float val = rright * perc + (1-perc) * rleft;
   return val;


}


noise - www.3daet.com