xxxxxxxxxx
61
// let h = 80;
// let i = 10;
// function setup() {
// createCanvas(500, 600);
// }
// function draw() {
// background(255);
// beginShape(LINES);
// for (let j = 1; j <= 7; j++) {
// let y = j * h;
// let x = h;
// for (let i = 1; i <= 7; i += 1) {
// vertex(x, y);
// x += 50;
// y += floor(random(-10, 10));
// vertex(x, y);
// // circle(x, y, 2);
// }
// }
// endShape();
// noLoop();
// }
let h = 80;
let i = 10;
let xoff = 0;
function setup() {
createCanvas(500, 600);
}
function draw() {
background(255);
beginShape(LINES);
for (let j = 1; j <= 7; j++) {
let y = j * h;
let x = h;
for (let i = 1; i <= 7; i += 1) {
vertex(x, y);
x += 50;
if(random()>0.5){
y += noise(xoff)*(h/4);
}else{
y -= noise(xoff)*(h/4);
}
vertex(x, y);
circle(x, y, 2);
xoff += 0.01;
}
}
endShape();
noLoop();
}