Visualizing Perlin Noise

This applet uses Processing’s “noise” function. Basically, it generates a bunch of randomly positioned particles. Every particle has a horizontal and vertical velocity component, xv and yv. When each particle is updated, xv is set to cos( noise(x,y)*TWO_PI) and yv is set to sin( noise(x,y)*TWO_PI ). What this is translated to is:

1. Choose a number from perlin noise between 0 and 1.

2. Multiply it by 2π in order to have a new number between 0 and 2π.

3. Take the sine or cosine of that new number depending on whether it is for xv or yv.

So this is what you end up with when you plot a point everywhere the particles go.

Perlin Force

Click to add 500 new particles. Tap any key to clear the screen and generate a new set of perlin noise values.

These are some shots of the basic applet described above along with a few variations that can be produced by modifying the xv and yv values.

 

About these ads

3 responses to “Visualizing Perlin Noise

    • Yeah, im having some trouble with the embed code for processing sketches, it seems to only work for chrome. if you know the right code that would be super helpful.

  1. Pingback: Tim Murray-Browne – interactive sound, creative code | Introduction to Processing workshop·

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s