//Aileen Craig //Homework 5 //Section A //aacraig@andrew.cmu.edu void setup ( ) { noFill( ); size( 600, 600); smooth( ); frameRate (80); } void draw ( ) { noStroke( ); drawUpperLeftQuadrant( ); drawLowerLeftQuadrant( ); drawUpperRightQuadrant( ); drawLowerRightQuadrant( ); } void drawUpperLeftQuadrant( ) { fill(#B942B9); rect( 0, 0, width/2 , height/2); noStroke (); float iWidth = width*.08; float iHeight = height*.08; drawInitials( frameCount%(width/2 - iWidth*3), height*.1 , iWidth , iHeight ); drawInitials((width/2 - iWidth*3) - (frameCount%(width/2 - iWidth*3)) , height*.3, iWidth, iHeight); } void drawLowerLeftQuadrant( ) { noStroke( ); fill(#37C4C3); rect (0, width/2, width/2, height/2); float iWidth = width*.08; float iHeight = height*.08; drawInitials (width*.02, height/2 + (frameCount%(height/2 - iHeight)), iWidth, iHeight); drawInitials (width*.26, (height - iHeight) - (frameCount%(height/2 - iHeight)), iWidth, iHeight); } void drawUpperRightQuadrant( ) { noStroke( ); fill(#F53693); rect (width/2, 0, width/2, height/2); float iWidth = width*.07; float iHeight = height*.07; drawInitials ((width*.51) + (frameCount%(width/2 - iWidth*3)), (frameCount%(height/2 - iHeight)), iWidth, iHeight); drawInitials ((width*.8) - (frameCount%(width/2 - iWidth*3)) , (frameCount%(height/2 - iHeight)), iWidth, iHeight); } void drawLowerRightQuadrant( ) { noStroke( ); fill(#58B452); rect (width/2, height/2, width/2, height/2); float iWidth = width*.07; float iHeight = height*.07; drawInitials ((width*.51) + (frameCount%(width/2 - iWidth*3)), (height - iHeight) - (frameCount%(height/2 - iHeight*.95)), iWidth, iHeight); drawInitials ((width*.8) - (frameCount%(width/2 - iWidth*3)) , (height - iHeight) - (frameCount%(height/2 - iHeight*.95)), iWidth, iHeight); } void drawInitials ( float x, float y, float iWidth, float iHeight) { strokeWeight(4); noFill(); //First A stroke(#060A4D); beginShape(); curveVertex(x + .12*iWidth, y + .95*iHeight); curveVertex(x + .1*iWidth, y + .9*iHeight); curveVertex(x + .5*iWidth, y + .1*iHeight); curveVertex(x + .9*iWidth, y + .9*iHeight); curveVertex(x + .75*iWidth, y + .95*iHeight); endShape(); beginShape(); curveVertex(x + .2*iWidth, y + .6*iHeight); curveVertex(x + .23*iWidth, y + .55*iHeight); curveVertex(x + .4*iWidth, y + .45*iHeight); curveVertex(x + .6*iWidth, y + .6*iHeight); curveVertex(x + .75*iWidth, y + .5*iHeight); curveVertex(x + .8*iWidth, y + .45*iHeight); endShape(); //Second A stroke(#E98CEA); beginShape(); curveVertex(x + 1.12*iWidth, y + .95*iHeight); curveVertex(x + 1.1*iWidth, y + .9*iHeight); curveVertex(x + 1.5*iWidth, y + .1*iHeight); curveVertex(x + 1.9*iWidth, y + .9*iHeight); curveVertex(x + 1.75*iWidth, y + .95*iHeight); endShape(); beginShape(); curveVertex(x + 1.2*iWidth, y + .6*iHeight); curveVertex(x + 1.23*iWidth, y + .55*iHeight); curveVertex(x + 1.4*iWidth, y + .45*iHeight); curveVertex(x + 1.6*iWidth, y + .6*iHeight); curveVertex(x + 1.75*iWidth, y + .5*iHeight); curveVertex(x + 1.8*iWidth, y + .45*iHeight); endShape(); //The C stroke (#ECF033); beginShape (); curveVertex (x + 2.6*iWidth, y + .4*iHeight); curveVertex (x + 2.65*iWidth, y + .35*iHeight); curveVertex (x + 2.55*iWidth, y + .15*iHeight); curveVertex (x + 2.2*iWidth, y + .5*iHeight); curveVertex (x + 2.55*iWidth, y + .9*iHeight); curveVertex (x + 2.65*iWidth, y + .7*iHeight); curveVertex (x + 2.6*iWidth, y + .65*iHeight); endShape (); }