xxxxxxxxxx
41
h = [
[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]
];
H = [];
size = 16
function setup() {
createCanvas(400, 400);
for (y = 0; y < h.length; y++) {
for (x = 0; x < h[0].length; x++) {
if (h[y][x] === 1) {
H.push(createVector(
h.length - (h.length / 2) - x,
h[0].length - (h[0].length / 2) - y - 1)
)
}
}
}
}
function draw() {
background(20);
strokeWeight(1)
stroke(0, 255, 0, 40)
line(width/2, 0, width/2, height)
line(0, height/2, width, height/2)
stroke(200)
strokeWeight(4)
for (p in H) {
point(width/2 - H[p].x * size, height/2 - H[p].y * size)
}
}