Processing Day 12: Perlin Noise

Today in my lynda.com tutorial I learned about Perlin Noise. According to the Processing.org website, “Perlin noise is a random sequence generator producing a more natural, harmonic succession of numbers than that of the standard random() function. It was invented by Ken Perlin in the 1980s and has been used in graphical applications to generate procedural textures, shapes, terrains, and other seemingly organic forms.” (From http://processing.org/reference/noise_.html).

I generates a different random formation each time you hit the play button.

Here are some screenshots of different instances where I loaded text into the sequence.

perlinnoise1

perlinnoise3

perlinnoise2

Here is the code:

int n = 100; //determines number of lines in picture
int x;
float y = .05;
float noiseY;

size(700, 300);
background(#B2CCCC);

//create forloop for drawing; good for something that repeats

for(int i = 1; i < n; i++) {
 y += .03;
 x = i* (width/n); //evenly distributes line across window
 noiseY = noise(y) * height;
 fill(#001A4C);
 text("word is weird", x, noiseY);
}