banner ad
Wednesday, March 07, 2007
Perlin Noise v2

In the displacementMapFilter v1post the black and white color gradient behind the image was a movieClip with an gradient color.  If we want to create a dynamic gradient map that generates pseudo-random results you use Perlin Noise.

In this example I am using a Perlin Noise to generate a movieClip where the b&w gradient shifts continually through the manipulation of the random seed number. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value.  I am also controling the number of octaves :  the individual noise functions to combine to create this noise. Try it, see how details gets better as octave increases but your CPU also starts to lag.  I am also introducing the offset; an array of points that correspond to x and y offsets for each octave. Each point in the offset array affects a specific octave noise function.  More points more movement.

	 	var seed = random(100); 	
var ocatves = sliderO/10;
var p = new Point(w, h);
var offsetArray = new Array(p, p, p, p, p);


»comments

Paul said...

Instead of updating the seed try animating your offsets. I think you'll be happy with the results. First, add a point for each octave.

for(var i: Number = 0; i < octaves; i++)
{
var point: Point = new Point(0, 0);
offsets.push(point);
}

And then update the point values at each interval.

for(var i: Number = 0; i < octaves; i++)
{
var point: Point = offsets[i] as Point;
point.y += (i * 1.25);
}

Be sure to set your seed to a fixed value.

var seed: Number = 1 // will do

That should give a nice effect.


Annette said...

I know it takes a lot of work - honestly I dont see this one - sorry


Name
URL
Email
*email address is not published
Remember Me
Comments

CAPTCHA






banner ad