Subscribed unsubscribe Subscribe Subscribe

Ex_00_06_PerlinNoise_2D

perlin noise 2D

// perlin noise
size(600,600);

loadPixels();
float xoff = 0.0;

for (int x=0; x<width; x++){
  float yoff = 0.0;
  for (int y=0; y<height; y++){
    float bright = map(noise(xoff,yoff), 0,1,0,255);
    pixels[x+y*width] = color(bright);
    yoff += 0.01;
  }
  xoff +=0.01;
}
updatePixels();
// random
size(600,600);

loadPixels();
for (int x=0; x<width; x++){
  for (int y=0; y<height; y++){
    float bright = random(255);
    pixels[x+y*width] = color(bright);
  }
}
updatePixels();