xxxxxxxxxx
let yoff = 0.0;
let numLines = 5;
let lineOffset = 10;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
stroke(0);
seed = Date.now();
}
function draw() {
noiseSeed(seed);
randomSeed(seed);
background(255);
let xoff = yoff;
for (let y = 0; y <= height; y += 5) {
let x = noise(xoff) * width / 4;
let sw = map(noise(yoff), 0, 1, 1, 8);
strokeWeight(sw);
for (let i = 0; i < numLines; i++) {
let offsetIndex = i - floor(numLines / 2);
let yOffset = y + offsetIndex * lineOffset;
if (yOffset % 4 == 0) {
line(0, yOffset, x, yOffset);
} else if (yOffset % 4 == 1) {
line(width / random(1.5, 2.5), yOffset, x + width, yOffset);
} else if (yOffset % 4 == 2) {
line(0, yOffset, x + width / 2, yOffset);
} else {
line(width, yOffset, x, yOffset);
}
}
xoff += 0.05;
}
yoff += 0.005;
}
function mousePressed() {
save("line_c_" + floor(random(100)) + "png");
}