// Homework 5 // Amy Nichols // Section D // aenichol@andrew.cmu.edu void setup( ) { size(600, 600); background(0); smooth( ); } void draw( ) { noStroke( ); drawUpperLeftQuadrant(); drawLowerLeftQuadrant(); drawUpperRightQuadrant(); drawLowerRightQuadrant(); } void drawUpperLeftQuadrant( ) { fill(#FA9F9F); noStroke(); rect(0,0,width/2,height/2); drawInitials((width*.05)+(frameCount%((width/2)-width*.2)), height*.1, width*.1, height*.1); drawInitials((width*.35)-(frameCount%((width/2)-width*.2)), height*.3, width*.1, height*.1); } void drawLowerLeftQuadrant( ) { fill(#B8BEFC); noStroke(); rect(0,height/2,width/2, height/2); drawInitials(width*.1, (height*.55)+(frameCount%((height/2)-height*.2)), width*.1, height*.1); drawInitials(width*.3, (height*.85)-(frameCount%((height/2)-height*.2)), width*.1, height*.1); } void drawUpperRightQuadrant( ) { // UpperRightQuadrant - WHY WONT THIS QUADRANT WORK?? fill(#BFFCB8); noStroke(); rect(width/2,0,width/2, height/2); drawInitials((width*.55)+(frameCount%((width/2)-width*.2)), (height*.05)+(frameCount%((height/2)-height*.2)), width*.1, height*.1); drawInitials((width*.85)-(frameCount%((width/2)-width*.2)), (height*.05)+(frameCount%((height/2)-height*.2)), width*.1, height*.1); } void drawLowerRightQuadrant( ) { fill(#FCB8ED); noStroke(); rect(width/2,height/2,width,height); drawInitials((width*.55)+(frameCount%((width/2)-width*.2)), (height*.85)-(frameCount%((width/2)-width*.2)), width*.1, height*.1); drawInitials((width*.85)-(frameCount%((width/2)-width*.2)), (height*.85)-(frameCount%((width/2)-width*.2)), width*.1, height*.1); } // Original Initials void drawInitials(float x, float y, float initialWidth, float initialHeight) { stroke(#FCC11C); strokeWeight(initialWidth/12); // made this elastic too! noFill(); // A curve beginShape(); curveVertex(x - initialWidth/12, y + initialHeight + initialHeight/10); curveVertex(x, y + initialHeight); curveVertex(x + initialWidth/6, y); curveVertex(x + initialWidth/3, y + initialHeight); curveVertex(x + .42*initialWidth, y + initialHeight + initialHeight/10); endShape(); // A "line" ellipse(x + initialWidth/6, y + .50*initialHeight, .17*initialWidth, .05*initialHeight); stroke(#980BD6); // E top curve beginShape(); curveVertex(x + .63*initialWidth, y + initialHeight + .30*initialHeight); curveVertex(x + .63*initialWidth, y + .25*initialHeight); curveVertex(x + .50*initialWidth, y); curveVertex(x + .38*initialWidth, y + .25*initialHeight); curveVertex(x + .50*initialWidth, y + .50*initialHeight); curveVertex(x + .58*initialWidth, y - .30*initialHeight); endShape(); // E bottom curve beginShape(); curveVertex(x + .63*initialWidth, y - .30*initialHeight); curveVertex(x + .63*initialWidth, y + .75*initialHeight); curveVertex(x + .50*initialWidth, y + initialHeight); curveVertex(x + .38*initialWidth, y + .75*initialHeight); curveVertex(x + .50*initialWidth, y + .50*initialHeight); curveVertex(x + .58*initialWidth, y + initialHeight + .30*initialHeight); endShape(); stroke(#E01B43); // N left curve beginShape(); curveVertex(x + .67*initialWidth, y - .10*initialHeight); curveVertex(x + .71*initialWidth, y); curveVertex(x + .75*initialWidth, y + .50*initialHeight); curveVertex(x + .71*initialWidth, y + initialHeight); curveVertex(x + .67*initialWidth, y + initialHeight + .10*initialHeight); endShape(); // N right curve beginShape(); curveVertex(x + initialWidth, y - .10*initialHeight); curveVertex(x + (initialWidth - .04*initialWidth), y); curveVertex(x + (initialWidth - .08*initialWidth), y + .5*initialHeight); curveVertex(x + (initialWidth - .04*initialWidth), y + initialHeight); curveVertex(x + initialWidth, y + initialHeight + .10*initialHeight); endShape(); // N connector line(x + .71*initialWidth, y, x + (initialWidth - .04*initialWidth), y + initialHeight); }