Perlin Noise

 

Class startup

[~]$ cd ~/cs40/examples/
[examples]$ \cp -r ~adanner/public/cs40/examples/w07-noise ./
Edit examples/CMakeLists.txt to add the w07-noise subdirectory.
Perlin Noise
Ken Perlin's 1999 Talk
Clouds

We need random noise maps. Add srand(time(NULL)) to NoiseGenerator constructor.

Let's build a color gradient map. We'll need some helper functions in test_noise

Make a gradient image. Let yval vary from 0 to 1 as the rows change, and let the img(j,i)=vecColor(lerp(blue, white, yval)),

Now add some noise. To a first approximation, something like this could work: yval = yval + 0.15*surf1(x,y);. Note yval could exceed the range 0 to 1. If so, clamp it, don't wrap it