class Noise { int xd,yd,xf,yf; float increment = 0.02; Noise(float XD,float YD,float XF,float YF) { xd=int(XD); yd=int(YD); xf=int(XF); yf=int(YF); } void Dessiner(){ loadPixels(); float xoff = 0.0; // Start xoff at 0 // For every x,y coordinate in a 2D space, calculate a noise value and produce a brightness value for (int x = xd; x < xf; x++) { xoff += increment; // Increment xoff float yoff = 0.0; // For every xoff, start yoff at 0 for (int y = yd; y < yf; y++) { yoff += increment; // Increment yoff // Calculate noise and scale by 255 float bright = noise(xoff,yoff)*255; // Try using this line instead //float bright = random(0,255); // Set each pixel onscreen to a grayscale value pixels[x+y*width] = color(bright); } } updatePixels(); } }