So if you run this sketch you'll see a grid of plus signs. I want to rotate each individual but i can't seem to figure it out. I tried translate, pushMatrix/popMatrix. But maybe it's not on the right place. I removed it now, maybe someone can point out how to rotate each individual plus sign around its own axis.
int rib;
void setup() {
size(1200, 800);
rib = 7;
}
void draw() {
background(0);
for (int i = -100; i < width+100; i = i + rib * 10) {
for (int j = -100; j < height+100; j = j + rib * 10) {
noStroke();
fill(255);
plus(i, j);
plus(3*rib+i, 1*rib+j);
plus(6*rib+i, 2*rib+j);
plus(9*rib+i, 3*rib+j);
plus(2*rib+i, 4*rib+j);
plus(5*rib+i, 5*rib+j);
plus(8*rib+i, 6*rib+j);
plus(1*rib+i, 7*rib+j);
plus(4*rib+i, 8*rib+j);
plus(7*rib+i, 9*rib+j);
}
}
}
void plus(int x, int y) {
pushMatrix();
beginShape();
vertex(x+0, y+0);
vertex(x+0, y+-rib);
vertex(x+rib, y+-rib);
vertex(x+rib, y+0);
vertex(x+2*rib, y+0);
vertex(x+2*rib, y+rib);
vertex(x+rib, y+rib);
vertex(x+rib, y+2*rib);
vertex(x+0, y+2*rib);
vertex(x+0, y+rib);
vertex(x+-rib, y+rib);
vertex(x+-rib, y+0);
endShape(CLOSE);
popMatrix();
}