//chongho lee //section a //chonghol@andrew.cmu.edu float x = width/8; float y = height/8; float boxWidth = width*0.75; float boxHeight = height*0.75; void setup() { size(600, 600); background(#000000); println ("Homework #5"); } void draw() { noStroke(); drawUpperLeftQuadrant(); drawUpperRightQuadrant(); drawLowerRightQuadrant(); drawLowerLeftQuadrant(); } void drawUpperLeftQuadrant() { noStroke(); fill(#FF0303); rect(0, 0, 0.5*width, 0.5*height); drawInitials (frameCount%(0.5*width), height*0.10, width*0.125, height*0.125); drawInitials ((0.5*width)-frameCount%(0.5*width)-0.15*width, height*0.30, width*0.125, height*0.125); } void drawLowerLeftQuadrant() { noStroke(); fill(#02AA0B); rect(0, 0.5*height, 0.5*width, 0.5*height); pushMatrix(); translate(0, height*0.5); drawInitials (width*0.10, frameCount%(0.5*height), width*0.125, height*0.125); drawInitials (width*0.30, (0.5*height)-frameCount%(0.5*height), width*0.125, height*0.125); popMatrix(); } void drawUpperRightQuadrant() { noStroke(); fill(#595CF5); rect(0.5*width, 0, 0.5*width, 0.5*height); pushMatrix(); translate(0.5*width, 0); drawInitials (frameCount%(0.5*width), frameCount%(0.5*height), width*0.125, height*0.125); drawInitials ((0.475*width)-(frameCount%(0.5*width)), frameCount%(0.5*height),width*0.125, height*0.125); popMatrix(); } void drawLowerRightQuadrant() { noStroke(); fill(#FFEA00); rect(0.5*width, 0.5*height, 0.5*width, 0.5*height); pushMatrix(); translate(0.5*width, 0.5*height); drawInitials ((0.5*width)-frameCount%(0.5*width), (0.5*height)-frameCount%(0.5*height), width*0.125, height*0.125); drawInitials (frameCount%(0.5*width)-(0.1*width), (0.5*height)-frameCount%(0.5*height),width*0.125, height*0.125); popMatrix(); } void drawInitials(float x, float y, float boxHeight, float boxWidth) { noFill(); strokeWeight(5); stroke(#EFF25F); beginShape(); curveVertex(x + .45*boxWidth, y + .45*boxHeight); curveVertex(x + .30*boxWidth, y + .30*boxHeight); curveVertex(x + .15*boxWidth, y + .15*boxHeight); curveVertex(x + .08*boxWidth, y + .25*boxHeight); curveVertex(x + .05*boxWidth, y + .50*boxHeight); curveVertex(x + .08*boxWidth, y + .75*boxHeight); curveVertex(x + .25*boxWidth, y + .85*boxHeight); curveVertex(x + .40*boxWidth, y + .70*boxHeight); curveVertex(x + .45*boxWidth, y + .60*boxHeight); endShape(); stroke(#F25F8C); beginShape(); curveVertex(x + .40*boxWidth, y + .05*boxHeight); curveVertex(x + .45*boxWidth, y + .10*boxHeight); curveVertex(x + .50*boxWidth, y + .35*boxHeight); curveVertex(x + .55*boxWidth, y + .50*boxHeight); curveVertex(x + .48*boxWidth, y + .65*boxHeight); curveVertex(x + .42*boxWidth, y + .78*boxHeight); curveVertex(x + .40*boxWidth, y + .82*boxHeight); curveVertex(x + .35*boxWidth, y + .88*boxHeight); endShape(); beginShape(); curveVertex(x + .25*boxWidth, y + .50*boxHeight); curveVertex(x + .55*boxWidth, y + .50*boxHeight); curveVertex(x + .65*boxWidth, y + .45*boxHeight); curveVertex(x + .70*boxWidth, y + .50*boxHeight); endShape(); beginShape(); curveVertex(x + .80*boxWidth, y + .05*boxHeight); curveVertex(x + .75*boxWidth, y + .10*boxHeight); curveVertex(x + .70*boxWidth, y + .35*boxHeight); curveVertex(x + .65*boxWidth, y + .50*boxHeight); curveVertex(x + .68*boxWidth, y + .65*boxHeight); curveVertex(x + .72*boxWidth, y + .78*boxHeight); curveVertex(x + .80*boxWidth, y + .82*boxHeight); curveVertex(x + .85*boxWidth, y + .88*boxHeight); endShape(); stroke(#3BFFAC); beginShape(); curveVertex(x + .85*boxWidth, y + .05*boxHeight); curveVertex(x + .90*boxWidth, y + .10*boxHeight); curveVertex(x + .93*boxWidth, y + .35*boxHeight); curveVertex(x + .95*boxWidth, y + .50*boxHeight); curveVertex(x + .92*boxWidth, y + .65*boxHeight); curveVertex(x + .88*boxWidth, y + .78*boxHeight); curveVertex(x + .84*boxWidth, y + .82*boxHeight); curveVertex(x + .80*boxWidth, y + .88*boxHeight); endShape(); beginShape(); curveVertex(x + .80*boxWidth, y + .77*boxHeight); curveVertex(x + .84*boxWidth, y + .82*boxHeight); curveVertex(x + .88*boxWidth, y + .84*boxHeight); curveVertex(x + .93*boxWidth, y + .85*boxHeight); curveVertex(x + .97*boxWidth, y + .85*boxHeight); curveVertex(x + 1.00*boxWidth, y + .84*boxHeight); curveVertex(x + 1.10*boxWidth, y + .80*boxHeight); curveVertex(x + 1.20*boxWidth, y + .72*boxHeight); endShape(); }