xxxxxxxxxx
// A hexagon made of 6 Escher style tessellating tiles
// mouse click to pause
// Escher, tile, tessellate, hexagon
float incr;
boolean pause;
void setup( ) {
size(600, 600);
background(0);
strokeCap(ROUND);
pause = false;
}
void draw() {
if (!pause) {
background(0);
translate(width/2, height/2);
ellipse(0, 0, 10, 10);
rotate(radians(incr));
for (int i = 0; i < 6; i++) {
translate(sin(incr/10)*15, sin(incr/10)*15);
fill(255);
noStroke();
ellipse(170, 0, 10, 10); //eye
noFill();
strokeWeight(.5);
stroke(255);
ellipse(170, 0, 15, 15); //eye
strokeWeight(3);
if (i % 2 == 0) stroke(#F74857);
else stroke(#F7C648);
beginShape(); //internal curve
noFill();
vertex(130, -20); // first point
bezierVertex(90, -5, 120, 100, 82, 102); // ctr, ctrl, end
endShape();
beginShape(); //tessellating shape
noFill();
vertex(0, 0); // first point
bezierVertex(30, -20, 100, -50, 130, -20); // ctr, ctrl, end
bezierVertex( 120, -15, 160, -40, 200, 0); // ctr, ctrl, end
endShape();
beginShape();
noFill();
vertex(100, 173.2051); // makes hexagon outer sides
vertex( 200, 0);
endShape();
rotate(TWO_PI/6);
beginShape(); // the same tessellating shape again
noFill();
vertex(0, 0); // first point
bezierVertex(30, -20, 100, -50, 130, -20); // ctr, ctrl, end
bezierVertex(120, -15, 160, -40, 200, 0); // ctr, ctrl, end
endShape();
}
incr -= .1;
}
}
void mousePressed() {
pause = !pause;
}