openFrameworks has a built-in implementation of simplex noise, implemented in the `ofNoise( t )`

function. For example, the following code draws the Perlin noise function, `ofNoise( t )`

, for `t`

ranging from `0`

to `10`

on the screen:

```
ofSetColor( 0, 0, 0 );
for (int x=0; x<1000; x++) {
float t = x * 0.01;
float y =
```**ofNoise( t )**;
ofLine( x, 300, x, 300 - y * 300 );
}

This is the example `13-PerlinNoise/01-PerlinGraph`

.

Run the code and you will see the following graph:

Now replace the line `float y = ofNoise( t );`

with the following line:

float y = ofNoise( t + 493.0 );

This code renders the noise function in the range [443, 453]. ...

Start Free Trial

No credit card required