Two dimensional noise
noise()function, we’ll do exactly the same thing, only instead of calling
var bright = map(noise(x,y), 0, 1, 0, 255);
y) location in our two-dimensional space. The problem is that this won’t have the cloudy quality we want. Jumping from pixel 200 to pixel 201 is too large of a jump through noise. Remember, when we worked with one-dimensional noise, we incremented our time variable by 0.01 each frame, not by 1! A pretty good solution to this problem is to just use different variables for the noise arguments. For example, we could increment a variable called
xoffeach time we move horizontally, and a
yoffvariable each time we move vertically through the nested loops.