xxxxxxxxxx
44
// instaperd by Moiré pattern :-)
// const plane1 = {};
// const plane2 = {};
// const _colors = ['red','green', 'blue'];
// https://editor.p5js.org/yu.shapkarin/sketches/CBHJckI9b
let angle = 0.72;
function setup() {
createCanvas(600, 600);
noStroke();
fill('red');
// todo: rename
let some = 4;
for (let y = some; y < width - some; y++) {
for (let x = some; x < height - some; x++) {
if ((x+y) % 2 == 0) {
fill('white')
} else {
fill('blue')
}
rect(x * some, y * some, some, some);
}
}
translate(200, -300);
rotate(angle);
for (let y = some; y < width - some; y++) {
for (let x = some; x < height - some; x++) {
if ((x+y) % 2 == 0) {
fill('rgba(255,255,255,0)')
} else {
fill('yellow')
// if(random() < 0.11) fill('red')
}
rect(x * some, y * some, some, some);
}
}
}