xxxxxxxxxx
36
function setup() {
createCanvas(400, 400);
console.log(true + false);
}
function draw() {
background(255);
stroke(0);
lineFlag(width/2, height/2, width/1.2,height/1.2,15,3);
}
function lineFlag(cx, cy, w, h, res, spacing=5){
let s = res/spacing;
// calculate top right corner
let nbW = w/res; // calculate number of lines on width
let nbH = h/res; // calculate number of lines on height
for(let i = 0 ; i < nbW; i++){
for(let j = 0; j < nbH; j++){
let x = cx - w/2 + i * res + res/2;
let y = cy - h/2 + j * res + res/2;
//circle(x,y,res);
//strokeWeight(noise(frameCount/100,x/10,y/10)*10)
push();
translate(x,y);
rotate(frameCount/100+noise(x/100,y/100)*200)
arc(0,0,s*1.5,s*1.5,PI/4,5*PI/4);
circle(s/3,-s/3,s/2);
line(-s,-s,s,s)
//circle(0,0,2)
pop();
}
}
}