xxxxxxxxxx
34
let free_sketching = [];
function setup() {
createCanvas(400, 400);
background(220);
}
function draw() {
for (let i = 0; i < free_sketching.length; i++) {
let new_drawing = free_sketching[i];
let x =
new_drawing.startX +
100 * noise(0.01 * frameCount + new_drawing.noiseX);
let y =
new_drawing.startY * noise(0.01 * frameCount + new_drawing.noiseY);
f_sketch(x, y);
}
}
function mousePressed() {
free_sketching.push({
startX: mouseX,
startY: mouseY,
noiseX: random(1000),
noiseY: random(1000)
});
}
function f_sketch(a, b) {
strokeWeight(1);
point(a, b);
}