
void setup() {
size(720, 480);
noLoop();
}
void draw() {
//Push original matrix
pushMatrix();
//Translate to center
translate(width/2, height/2);
//Outer Grey Squares
scale(2);
for(float k = 0; k < 2; k += .5) {
rotate(k * PI);
fill(102);
rect(20, 20, 150, 150);
}
//Diagonal Grey Squares
scale(.55);
rotate(.25 * PI);
for(float k = 0; k < 2; k += .5) {
rotate(k * PI);
rect(20, 20, 150, 150);
}
//Black Center
for(float k = 0; k < 2; k += .10) {
rotate(k*PI);
fill(0);
rect(20, 20, 90, 90);
}
//Pop to orinal origin
popMatrix();
//Pop original origin
pushMatrix();
//Left diagonal of Triangles
for(int i = 0; i < 3; i++) {
translate(width/4, height/4);
for(float k = 1; k < 3; k += .10) {
rotate(k * PI);
triangle(0, 0, 15, 0, 0, 20);
}
}
popMatrix();
pushMatrix();
translate(width, 0);
//Right Diagonal of Rotated Triangles
for(int i = 0; i < 3; i++) {
translate(-width/4, height/4);
for(float k = 1; k < 3; k += .10) {
rotate(k * PI);
triangle(0, 0, 15, 0, 0, 20);
}
}
}
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment