//Aileen Craig //Homework 4B //Section A //aacraig@andrew.cmu.edu void setup ( ) { size( 400, 400); background( #58B452 ); smooth( ); frameRate( 10 ); } void draw( ) { float iWidth = width*.05; float iHeight = height*.05; float rWidth = width*random (.02,.12); float rHeight = height*random (.02,.12); drawInitials (random(0, width - rWidth*3),random(0, height - rHeight), rWidth, rHeight); } void drawInitials ( float x, float y, float iWidth, float iHeight) { strokeWeight(5); 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(#CE2AB0); 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 (); }