xxxxxxxxxx
30
//#Processing
/* Inspired by P-122, a classic drawing by Manfred Mohr
https://www.studiointernational.com/index.php/chance-and-control-art-in-the-age-of-computers-review-victoria-albert-museum */
var a,b;
function setup() {
//sX and sY define the spacing at X and Y.
// You can try getting both equal or changing
// sX=5 and sY=sX*2
var sX=20,sY=sX,sQ=sX*1.25,x,y,q=0,m;
createCanvas(800, 600);
background(0);
stroke(255);
for(y=0;y<height;y+=sY){
for(x=0;x<width;x+=sQ){
m=(sX/2)*noise(q++);
z=x+sX;
w=y-sY*.9*noise(q++);
a=x;b=y;
l(x+m,w);
l(z-m,w);
l(z,y);l(x+sQ,y);
}
q++;
}
}
function l(x,y){
line (a,b,x,y);
a=x;b=y;
}