Posts Tagged 'vector field'

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.


Categories

Moi

I am a programmer in training and I post all my projects and experiments on this blog. Most of my work is done with Adobe Flash, Processing, and Arduino.

Flashy Programming Flickr Photos

SpringyPoints7872

SpringyPoints24387

SpringyPoints18980

SpringyPoints2664

SpringyPoints10737

SpringyPoints21038

SpringyPoints7554

SpringyPoints25562

SpringyPoints3409

SpringyPoints2638

More Photos

Follow

Get every new post delivered to your Inbox.