/*Erica D. Cochran Section B ericac@andrew.cmu.edu Copyright © Erica D. Cochran September 9, 2009 Carnegie Mellon University Exploring Programming with Graphics All Rights Reserved */ void setup() { size(600,600); smooth(); background(10); drawBigInitial(); } void drawInitials(float x, float y, float iw, float ih) { //Letter E of initials noFill(); beginShape(); strokeWeight(1); stroke(250,70,150); curveVertex(x+(.3*iw),y+(.23*ih)); curveVertex(x+(.3*iw),y+(.23*ih)); curveVertex(x+(.2*iw),y+(.167*ih)); curveVertex(x+(.05*iw),y+(.33*ih)); curveVertex(x+(.175*iw),y+(.53*ih)); curveVertex(x+(.2*iw),y+(.58*ih)); curveVertex(x+(.2*iw),y+(.58*ih)); endShape(); //midpoint beginShape(); strokeWeight(1); stroke(250,40,100); curveVertex(x+(.2*iw),y+(.58*ih)); curveVertex(x+(.2*iw),y+(.58*ih)); curveVertex(x+(.175*iw),y+(.633*ih)); curveVertex(x+(.05*iw),y+(.833*ih)); curveVertex(x+(.2*iw),(y+ih)); curveVertex(x+(.3*iw),y+(.833*ih)); curveVertex(x+(.3*iw),y+(.833*ih)); endShape(); //Letter D //Vertical part of letter beginShape(); strokeWeight(1); stroke(255,200,70); curveVertex(x+(.375*iw),y+(.167*ih)); curveVertex(x+(.375*iw),y+(.167*ih)); curveVertex(x+(.425*iw),y+(.58*ih)); curveVertex(x+(.375*iw),y+ih); curveVertex(x+(.375*iw),y+ih); endShape(); //Curved part of letter beginShape(); strokeWeight(1); stroke(25,255,10); curveVertex(x+(.375*iw),y+(.167*ih)); curveVertex(x+(.375*iw),y+(.167*ih)); curveVertex(x+(.625*iw),y+(.58*ih)); curveVertex(x+(.375*iw),y+ih); curveVertex(x+(.375*iw),y+ih); endShape(); //Letter C //Top Swirl of C beginShape(); strokeWeight(1); stroke(105,100,255); curveVertex(x+(.96*iw),y+(.26*ih)); curveVertex(x+(.96*iw),y+(.26*ih)); curveVertex(x+(.975*iw),y+(.25*ih)); curveVertex(x+(.96*iw),y+(.23*ih)); curveVertex(x+(.95*iw),y+(.26*ih)); curveVertex(x+(.975*iw),y+(.3*ih)); curveVertex((x+iw),y+(.23*ih)); curveVertex((x+iw),y+(.23*ih)); endShape(); //Big curved protion of letter C beginShape(); strokeWeight(1); stroke(15,205,255); curveVertex((x+iw),y+(.23*ih)); curveVertex((x+iw),y+(.23*ih)); curveVertex(x+(.875*iw),y+(.167*ih)); curveVertex(x+(.7*iw),y+(.58*ih)); curveVertex(x+(.875*iw),y+ih); curveVertex((x+iw),y+(.83*ih)); curveVertex((x+iw),y+(.83*ih)); endShape(); //Bottom Swirl of C beginShape(); strokeWeight(1); stroke(105,100,255); curveVertex((x+iw),y+(.83*ih)); curveVertex((x+iw),y+(.83*ih)); curveVertex(x+(.975*iw),y+(.76*ih)); curveVertex(x+(.94*iw),y+(.8*ih)); curveVertex(x+(.945*iw),y+(.83*ih)); curveVertex(x+(.97*iw),y+(.82*ih)); curveVertex(x+(.965*iw),y+(.80*ih)); curveVertex(x+(.965*iw),y+(.80*ih)); endShape(); } void drawBigInitial() { //top of letter E drawInitials(.25*width, .125*height, .025*width, .025*height); drawInitials(.375*width, .125*height, .025*width, .025*height); drawInitials(.5*width, .125*height, .025*width, .025*height); drawInitials(.625*width, .125*height, .025*width, .025*height); drawInitials(.75*width, .125*height, .025*width, .025*height); //middle of letter E drawInitials(.25*width, .5*height, .025*width, .025*height); drawInitials(.375*width, .5*height, .025*width, .025*height); drawInitials(.5*width, .5*height, .025*width, .025*height); //bottom of letter E drawInitials(.25*width, .875*height, .025*width, .025*height); drawInitials(.375*width, .875*height, .025*width, .025*height); drawInitials(.5*width, .875*height, .025*width, .025*height); drawInitials(.625*width, .875*height, .025*width, .025*height); drawInitials(.75*width, .875*height, .025*width, .025*height); //vertical of letter E, only missing portions drawInitials(.25*width, .25*height, .025*width, .025*height); drawInitials(.25*width, .375*height, .025*width, .025*height); drawInitials(.25*width, .625*height, .025*width, .025*height); drawInitials(.25*width, .75*height, .025*width, .025*height); }