xxxxxxxxxx
39
// <3
PBN = [
[0, 1, 1, 0, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[0, 1, 1, 1, 1, 1, 0],
[0, 0, 1, 1, 1, 0, 0],
[0, 0, 0, 1, 0, 0, 0]
];
function setup() {
createCanvas(800, 800);
s = 80;
}
function draw() {
background(20);
cx = width / 2;
cy = height / 2;
stroke(255, 0, 0);
for (y = 0; y < PBN[1].length; y++) {
for (x = 0; x < PBN.length; x++) {
if (PBN[x][y] === 1) {
// sw = 80 * abs(sin(frameCount / 25));
sw = 80 * abs(sin(sqrt((x - cx^2) + (y - cy^2))));
strokeWeight(s);
point(
cx + (PBN.length / 2) * s - y * s,
cy - (PBN.length / 2) * s + x * s
);
}
}
}
}