xxxxxxxxxx
56
const AMT = 42;
const mess = 12;
var marg;
var t = 0;
var dt =0.32145;
function setup() {
// this one is for a4 format
createCanvas(2480/4,3508/4, SVG);
// createCanvas(400, 400, SVG);
marg = (width)/30;
rectMode(CENTER);
colorMode(HSB);
createButton('save').mousePressed(function(e){
save("mySVG.svg"); // give file name
print("saved svg");
})
noFill();
}
function mouseClicked() {
// background(random()*100, random()*100, 100)
clear()
t=0
dt += random(-0.01,0.01);
loop()
}
function draw() {
for (var i = 0 ; i< AMT ;i++) {
cx = random(marg, width-marg);
cy = random(marg, height-marg);
for (var j = 0 ; j < mess ;j++){
sx = random(cx-marg, cx+marg);
sy = random(cy-marg, cy+marg);
push();
translate(sx,sy);
rotate(sx)
stroke(
j*t*i/100- random(0,50),
noise(t*j)*100+random(50,100),
random(100,255));
strokeWeight(random(1,3)/4)
square(0,0, marg);
pop();
t+=dt;
}
}
noLoop();
}