// Homework 4A // Amy Nichols // Section D // aenichols@cmu.edu void setup( ) { size(600, 600); smooth(); background(255); } 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); } void draw() { println (frameCount); fill(255,30); noStroke(); rect(0,0,width,height); frameRate(5); drawInitials((int)random (width - ((width*.19) +width*.01)), (int)random (height - ((height*.19) +height*.01)), (int)random(width*.20) +width*.02, (int)random(height*.20) +height*.02); // cast & offset }