{"id":65695,"date":"2021-09-11T23:26:45","date_gmt":"2021-09-12T03:26:45","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=65695"},"modified":"2021-09-11T23:32:09","modified_gmt":"2021-09-12T03:32:09","slug":"project-2-variable-faces-13","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/11\/project-2-variable-faces-13\/","title":{"rendered":"Project 2: Variable Faces"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div class=\"wp-block-file\"><a class=\"p5_sketch_link\" data-width=\"640\" data-height=\"840\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-110.js\">kstargio proj2 <\/a><a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-110.js\" class=\"wp-block-file__button\" download>Download<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"640\" height=\"840\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ Katherine Stargiotti, kstargio, B\n\n\/\/ PORTRAIT VARIABLES:\n\t\/\/HEAD:\nvar headWidth = 640\/2 - 10;\nvar headHeight = 840\/1.75 - 10;\n\t\/\/SKIN:\nvar skinTone = 3;\n\t\/\/EYES:\nvar eyeWidth = 55;\t\/\/(40, 65)\nvar eyeHeight = 30;\t\/\/(15, 35)\nvar eyeSpread = 12;\t\/\/(10, 15)\nvar eyeColor = 1;\t\/\/(1, 4)\nvar pupilHeight = 27;\n\t\/\/NOSE:\nvar noseSpread = 60;\nvar noseWidth = 10;\t\/\/(10, 23)\nvar noseHeight = 60;\t\/\/(55, 70)\n\t\/\/MOUTH:\nvar lipColor = 3;\nvar mouthHeight = 5*840\/8\nvar mouthShape = 1\n\t\/\/HAIR:\nvar hairColor = 3\nvar hairStyle = 1\n\n\nfunction setup() {\n    createCanvas(640, 840);\n}\n\nfunction draw() {\n    background(110, 70, 110);\t\t\/\/moved to draw function so faces dont pile up \n\/\/SKINTONE:\n\tnoStroke();\n\tif (skinTone &lt;= 1) {\n\t\tfill(240, 211, 202);\t\t\/\/lightest\n\t} else if (skinTone &lt;= 2) {\n\t\tfill(246, 200, 167);\n\t} else if (skinTone &lt;= 3) {\n\t\tfill(219, 140, 95);\n\t} else if (skinTone &lt;= 4) {\n\t\tfill(121, 69, 53);\n\t} else {\n\t\tfill(42, 31, 27);\t\t\t\/\/darkest\n\t}\n\/\/HEAD:\n    ellipse(width\/2, height\/2, headWidth, headHeight);\n\/\/EYES (whites):\n    \tfill(255);\n    \tstroke(0);\n    \tstrokeWeight(1);\n    ellipse(width\/2 - 5*eyeSpread, height\/2 - 25, eyeWidth, 15);\n    ellipse(width\/2 + 5*eyeSpread, height\/2 - 25, eyeWidth, 15);\n    arc(width\/2 - 5*eyeSpread, height\/2 - 25, eyeWidth, eyeHeight, PI, 0);\n    arc(width\/2 + 5*eyeSpread, height\/2 - 25, eyeWidth, eyeHeight, PI, 0);\n\/\/EYES (iris):\n    \tnoStroke();\n    \tfill(0);\n    if (eyeHeight &lt;= 18) {\t\t\t\t\/\/conditional statements for IRIS & PUPIL PLACEMENT \n\t    pupilHeight = 27;\n\t} else if (eyeHeight &lt;= 22) {\n\t\tpupilHeight = 28;\n\t} else if (eyeHeight &lt;= 26) {\n\t\tpupilHeight = 29;\n\t} else if (eyeHeight &lt;= 30) {\n\t\tpupilHeight = 31;\n\t} else if (eyeHeight &lt;= 33) {\n\t\tpupilHeight = 32;\n\t} else {\n\t\tpupilHeight = 33;\n\t}\n\tif (eyeColor &lt;= 1) {\t\t\t\t\/\/conditional statements for EYECOLOR\n\t\tfill(64, 106, 138);\t\t\t\t\/\/blue\n\t} else if (eyeColor &lt;= 2) {\n\t\tfill(48, 24, 23);\t\t\t\t\/\/dark brown\n\t} else if (eyeColor &lt;= 3) {\n\t\tfill(100, 61, 27);\t\t\t\t\/\/light brown\n\t} else {\n\t\tfill(105, 85, 25);\t\t\t\t\/\/green\/hazel \n\t}    \t\t\t\t\t\t\t\t\/\/ arcs for iriss \n    arc(width\/2 - 5*eyeSpread, height\/2 - pupilHeight, eyeWidth\/2, eyeHeight*.8, PI+HALF_PI+QUARTER_PI, PI+(QUARTER_PI), OPEN);\n    arc(width\/2 + 5*eyeSpread, height\/2 - pupilHeight, eyeWidth\/2, eyeHeight*.8, PI+HALF_PI+QUARTER_PI, PI+QUARTER_PI, OPEN);\n\/\/EYES (pupils):\n    \tfill(0);\n    ellipse(width\/2 - 5*eyeSpread, height\/2 - pupilHeight, eyeWidth\/3, eyeHeight*.5);\n    ellipse(width\/2 + 5*eyeSpread, height\/2 - pupilHeight, eyeWidth\/3, eyeHeight*.5);\n    \tfill(255);\t\t\t\t\t\t\t\/\/glare\n    ellipse(width\/2 - 5*eyeSpread + eyeWidth\/12, height\/2 - pupilHeight - eyeHeight\/12, eyeWidth\/8, eyeHeight\/6);\n    ellipse(width\/2 + 5*eyeSpread + eyeWidth\/12, height\/2 - pupilHeight - eyeHeight\/12, eyeWidth\/8, eyeHeight\/6);\n    ellipse(width\/2 - 5*eyeSpread + eyeWidth\/9, height\/2 - pupilHeight + eyeHeight\/12, eyeWidth\/16, eyeHeight\/11);\n    ellipse(width\/2 + 5*eyeSpread + eyeWidth\/9, height\/2 - pupilHeight + eyeHeight\/12, eyeWidth\/16, eyeHeight\/11);\n\/\/EYES (lashes):\n    \tstroke(0);\n    \tstrokeWeight(3);\n    \tnoFill();\n    arc(width\/2 - 5*eyeSpread, height\/2 - 25, eyeWidth, eyeHeight, PI, 0, OPEN);\n    arc(width\/2 + 5*eyeSpread, height\/2 - 25, eyeWidth, eyeHeight, PI, 0);\n\/\/NOSE (lines):\n    \tnoFill();\n        stroke(0);\n\t\tstrokeWeight(1);\n\tarc(width\/2 - noseSpread, height\/2 + 15, 95, 175, PI+HALF_PI+QUARTER_PI, QUARTER_PI\/2);\n\tarc(width\/2 + noseSpread, height\/2 + 15, 95, 175, PI-(QUARTER_PI)\/2, PI+QUARTER_PI);\n\/\/NOSE (bump shadow):\n    \tnoFill();\n\t\tstrokeWeight(5);\n\tif (skinTone &lt;= 1) {\n\t\tstroke(230, 201, 192);\t\t\/\/lightest skintone\n\t} else if (skinTone &lt;= 2) {\n\t\tstroke(236, 190, 157);\n\t} else if (skinTone &lt;= 3) {\n\t\tstroke(209, 130, 85);\n\t} else if (skinTone &lt;= 4) {\n\t\tstroke(111, 59, 43);\n\t} else {\n\t\tstroke(32, 21, 17);\t\t\t\/\/darkest skintone\n\t}\n    arc(width\/2, height\/2 + 70, noseWidth + 10, 25, PI+QUARTER_PI, -QUARTER_PI), OPEN;\n\/\/NOSE (nostrils):\n\t\tstroke(0);\n\t\tstrokeWeight(1);\n    beginShape();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \"W\" shape for nostrils:\n\tcurveVertex(width\/2 - (noseWidth+12), height\/2 + (noseHeight+7));\n\tcurveVertex(width\/2 - (noseWidth+12), height\/2 + (noseHeight+7));\n\tcurveVertex(width\/2 - (noseWidth+17), height\/2 + (noseHeight+12));\n\tcurveVertex(width\/2 - (noseWidth+17), height\/2 + (noseHeight+20));\n    curveVertex(width\/2 - (noseWidth+10), height\/2 + (noseHeight+23));\n    curveVertex(width\/2 - noseWidth, height\/2 + 80);\n    curveVertex(width\/2, height\/2 + 85);\n    curveVertex(width\/2 + noseWidth, height\/2 + 80);\n    curveVertex(width\/2 + (noseWidth+10), height\/2 + (noseHeight+23));\n\tcurveVertex(width\/2 + (noseWidth+17), height\/2 + (noseHeight+20));\n\tcurveVertex(width\/2 + (noseWidth+17), height\/2 + (noseHeight+12));\n\tcurveVertex(width\/2 + (noseWidth+12), height\/2 + (noseHeight+7));\n\tcurveVertex(width\/2 + (noseWidth+12), height\/2 + (noseHeight+7));\n    endShape();\n\/\/MOUTH (shape):\n    if (mouthShape &lt;= 1) {\n\t\tfill(236, 240, 215);\n\t} else {\n        if (lipColor &lt;= 1) {\n\t    \tfill(245, 195, 195);\n\t    } else if (lipColor &lt;= 2) {\n\t\t\tfill(255, 175, 145);\n\t    } else if (lipColor &lt;= 3) {\n\t\t\tfill(235, 125, 85);\n\t    } else if (lipColor &lt;= 4) {\n\t\t\tfill(95, 39, 33);\n\t    } else {\n\t\t\tfill(52, 21, 17);\n\t}}\t\t\n\t\n\/\/MOUTH (closed bottom lip \/ teeth shape):\n    beginShape();\n    curveVertex(width\/2 + 65, mouthHeight + 15);\t\t\/\/right far (not drawn)\n    curveVertex(width\/2 + 60, mouthHeight + 17);\t\t\/\/ almost right far\n    curveVertex(width\/2 + 45, mouthHeight + 20);\t\t\n    curveVertex(width\/2 + 15, mouthHeight + 20);\n    curveVertex(width\/2, mouthHeight + 22);\t\t\t\/\/mid mid\n    curveVertex(width\/2 - 15, mouthHeight + 20);\n    curveVertex(width\/2 - 45, mouthHeight + 20);\t\t\n    curveVertex(width\/2 - 60, mouthHeight + 17);\t\t\/\/almost left far\n    curveVertex(width\/2 - 65, mouthHeight + 15);\t\t\/\/left far\n    curveVertex(width\/2 - 55, mouthHeight + 23);\t\t\n    curveVertex(width\/2 - 40, mouthHeight + 32);\t\t\n    curveVertex(width\/2 - 15, mouthHeight + 40);\n    curveVertex(width\/2, mouthHeight + 39);\t\t\t\/\/mid bottom\n    curveVertex(width\/2 + 15, mouthHeight + 40);\n    curveVertex(width\/2 + 40, mouthHeight + 32);\t\t\n    curveVertex(width\/2 + 55, mouthHeight + 23);\t\t\n    curveVertex(width\/2 + 65, mouthHeight + 15);\t\t\/\/right far\n    curveVertex(width\/2 + 60, mouthHeight + 17);\t\t\/\/ almost right far\n    curveVertex(width\/2 + 45, mouthHeight + 20);\t\t\n    curveVertex(width\/2 + 45, mouthHeight + 20);\t\t\n    endShape();\n    if (mouthShape &lt;= 1) {\n\t\tline(width\/2 - 52, mouthHeight + 18, width\/2 - 52, mouthHeight + 27);\n\t\tline(width\/2 - 45, mouthHeight + 18, width\/2 - 45, mouthHeight + 28);\n\t\tline(width\/2 - 37, mouthHeight + 18, width\/2 - 37, mouthHeight + 30);\n\t\tline(width\/2 - 27, mouthHeight + 18, width\/2 - 27, mouthHeight + 32);\n\t\tline(width\/2 - 15, mouthHeight + 18, width\/2 - 15, mouthHeight + 34);\n\t\tline(width\/2, mouthHeight + 18, width\/2, mouthHeight + 37);\t\t\/\/middle line\n\t\tline(width\/2 + 15, mouthHeight + 18, width\/2 + 15, mouthHeight + 34);\n\t\tline(width\/2 + 27, mouthHeight + 18, width\/2 + 27, mouthHeight + 32);\n\t\tline(width\/2 + 37, mouthHeight + 18, width\/2 + 37, mouthHeight + 30);\n\t\tline(width\/2 + 45, mouthHeight + 18, width\/2 + 45, mouthHeight + 28);\n\t\tline(width\/2 + 52, mouthHeight + 18, width\/2 + 52, mouthHeight + 27);\n\t} else {\n\t\tnull;\n\t}\n\tif (lipColor &lt;= 1) {\n\t    \tfill(245, 195, 195);\n\t    } else if (lipColor &lt;= 2) {\n\t\t\tfill(255, 175, 145);\n\t    } else if (lipColor &lt;= 3) {\n\t\t\tfill(235, 125, 85);\n\t    } else if (lipColor &lt;= 4) {\n\t\t\tfill(95, 39, 33);\n\t    } else {\n\t\t\tfill(52, 21, 17);\n\t}\n\/\/MOUTH (open bottom lip):\n    if (mouthShape &lt;= 1) {\n    \tbeginShape();\n    \tcurveVertex(width\/2 + 65, mouthHeight + 16);\t\t\/\/right far (not drawn)\n    \tcurveVertex(width\/2 + 60, mouthHeight + 18);\t\t\/\/ almost right far\n    \tcurveVertex(width\/2 + 45, mouthHeight + 20 + 5);\t\t\n    \tcurveVertex(width\/2 + 15, mouthHeight + 20 + 12);\n    \tcurveVertex(width\/2, mouthHeight + 22 + 11);\t\t\t\/\/mid mid\n    \tcurveVertex(width\/2 - 15, mouthHeight + 20 + 12);\n    \tcurveVertex(width\/2 - 45, mouthHeight + 20 + 5);\t\t\n    \tcurveVertex(width\/2 - 60, mouthHeight + 18);\t\t\/\/almost left far\n    \tcurveVertex(width\/2 - 65, mouthHeight + 16);\t\t\/\/left far\n    \tcurveVertex(width\/2 - 55, mouthHeight + 23 + 5);\t\t\n    \tcurveVertex(width\/2 - 40, mouthHeight + 32 + 7);\t\t\n    \tcurveVertex(width\/2 - 15, mouthHeight + 40 + 10);\n    \tcurveVertex(width\/2, mouthHeight + 39 + 10);\t\t\t\/\/mid bottom\n    \tcurveVertex(width\/2 + 15, mouthHeight + 40 + 10);\n    \tcurveVertex(width\/2 + 40, mouthHeight + 32 + 7);\t\t\n    \tcurveVertex(width\/2 + 55, mouthHeight + 23 + 5);\t\t\n    \tcurveVertex(width\/2 + 65, mouthHeight + 15);\t\t\/\/right far\n    \tcurveVertex(width\/2 + 60, mouthHeight + 17);\t\t\/\/ almost right far\n    \tcurveVertex(width\/2 + 45, mouthHeight + 20);\t\t\n    \tcurveVertex(width\/2 + 45, mouthHeight + 20);\t\t\n    \tendShape();\t\n    } else {\n\t    null;\n\t}\n\/\/MOUTH (top lip):\n    beginShape();\n    curveVertex(width\/2 - 65, mouthHeight + 15);\t\t\/\/left far (not drawn)\n    curveVertex(width\/2 - 11, mouthHeight + 5);\n    curveVertex(width\/2, mouthHeight + 7);\t\t\t\/\/mid top\n    curveVertex(width\/2 + 11, mouthHeight + 5);\n    curveVertex(width\/2 + 63, mouthHeight + 14);\t\t\/\/right far\n    curveVertex(width\/2 + 60, mouthHeight + 17);\t\t\n    curveVertex(width\/2 + 45, mouthHeight + 20);\t\t\n    curveVertex(width\/2 + 15, mouthHeight + 20);\n    curveVertex(width\/2, mouthHeight + 22);\t\t\t\/\/mid bottom\n    curveVertex(width\/2 - 15, mouthHeight + 20);\n    curveVertex(width\/2 - 45, mouthHeight + 20);\n    curveVertex(width\/2 - 60, mouthHeight + 17);\n    curveVertex(width\/2 - 63, mouthHeight + 14);\t\t\/\/left far \n    curveVertex(width\/2 - 11, mouthHeight + 5);\n    curveVertex(width\/2 - 11, mouthHeight + 5);\t\t\/\/left mid top (drawn)\n    endShape();\n\/\/HAIR (color):\n\tif (hairColor &lt;= 1) {\n\t\tstroke(0);\n\t\tfill(0);\n\t} else if (hairColor &lt;= 2) {\n\t\tstroke(127);\n\t\tfill(127);\n\t} else if (hairColor &lt;= 3) {\n\t\tstroke(23, 9, 7);\n\t\tfill(23, 9, 7);\n\t} else if (hairColor &lt;= 4) {\n\t\tstroke(93, 58, 42);\n\t\tfill(93, 58, 42);\n\t} else if (hairColor &lt;= 5) {\n\t\tstroke(83, 30, 12);\n\t\tfill(83, 30, 12);\n\t} else if (hairColor &lt;= 6) {\n\t\tstroke(226, 174, 126);\n\t\tfill(226, 174, 126);\n\t} else {\n\t\tstroke(51, 9, 4);\n\t\tfill(51, 9, 4);\n\t}\n\/\/EYEBROWS:\n\t\/\/left brow:\n\tquad(width\/2 - headWidth\/4 - eyeSpread\/2, height\/2 - headHeight\/7 - 4, \n\t\t\t\t\t   width\/2 - headWidth\/9, \t  height\/2 - headHeight\/7, \n\t\t \t\t\twidth\/2 - headWidth\/9 +3, \t  height\/2 - headHeight\/8,\n\t\t width\/2 - headWidth\/4 - eyeSpread\/2, height\/2 - headHeight\/8 - 5);\t\n\t\t\t\t\t\n\tbeginShape();\n\tcurveVertex(width\/2 - headWidth\/4 - eyeSpread\/2, height\/2 - headHeight\/7 - 4);\n\tcurveVertex(width\/2 - headWidth\/4 - eyeSpread\/2, height\/2 - headHeight\/7 - 4);\n\tcurveVertex(width\/2 - headWidth\/4 - eyeSpread\/2 - 10, height\/2 - headHeight\/7 - 4);\n\tcurveVertex(width\/2 - headWidth\/4 - eyeSpread\/2 - 20, height\/2 - headHeight\/7);\n\tcurveVertex( width\/2 - headWidth\/4 - eyeSpread\/2 - 30, height\/2 - headHeight\/8 + 4);\n\tcurveVertex( width\/2 - headWidth\/4 - eyeSpread\/2 - 20, height\/2 - headHeight\/8 - 2);\n\tcurveVertex( width\/2 - headWidth\/4 - eyeSpread\/2 - 10, height\/2 - headHeight\/8 - 5);\t\n\tcurveVertex( width\/2 - headWidth\/4 - eyeSpread\/2, height\/2 - headHeight\/8 - 5);\n\tcurveVertex( width\/2 - headWidth\/4 - eyeSpread\/2, height\/2 - headHeight\/8 - 5);\n\tendShape();\n\t\/\/right brow:\n\tquad(width\/2 + headWidth\/4 + eyeSpread\/2, height\/2 - headHeight\/7 - 4, \n\t\t\t\t\t   width\/2 + headWidth\/9, \t  height\/2 - headHeight\/7, \n\t\t \t\t   width\/2 + headWidth\/9 - 3, \t  height\/2 - headHeight\/8,\n\t\t width\/2 + headWidth\/4 + eyeSpread\/2, height\/2 - headHeight\/8 - 5);\t\n\t\t\t\t\t\n\tbeginShape();\n\tcurveVertex(width\/2 + headWidth\/4 + eyeSpread\/2, height\/2 - headHeight\/7 - 4);\n\tcurveVertex(width\/2 + headWidth\/4 + eyeSpread\/2, height\/2 - headHeight\/7 - 4);\n\tcurveVertex(width\/2 + headWidth\/4 + eyeSpread\/2 + 10, height\/2 - headHeight\/7 - 4);\n\tcurveVertex(width\/2 + headWidth\/4 + eyeSpread\/2 + 20, height\/2 - headHeight\/7);\n\tcurveVertex( width\/2 + headWidth\/4 + eyeSpread\/2 + 30, height\/2 - headHeight\/8 + 4);\n\tcurveVertex( width\/2 + headWidth\/4 + eyeSpread\/2 + 20, height\/2 - headHeight\/8 - 2);\n\tcurveVertex( width\/2 + headWidth\/4 + eyeSpread\/2 + 10, height\/2 - headHeight\/8 - 5);\t\n\tcurveVertex( width\/2 + headWidth\/4 + eyeSpread\/2, height\/2 - headHeight\/8 - 5);\n\tcurveVertex( width\/2 + headWidth\/4 + eyeSpread\/2, height\/2 - headHeight\/8 - 5);\n\tendShape();\n\/\/HAIR (style):\n\tif (hairStyle &lt;= 1) {\n\t\t\/\/HAIRSTYLE 1:\n\t\t\/\/left pony:\n\t\tbeginShape();\n\t\tcurveVertex(width\/2 - headWidth\/4.5, height\/2 - headHeight\/3);\n\t\tcurveVertex(width\/2 - headWidth\/4.5, height\/2 - headHeight\/2.25);\n\t\tcurveVertex(width\/2 - headWidth\/3.5, height\/2 - headHeight\/2);\n\t\tcurveVertex(width\/2 - headWidth\/2.5, height\/2 - headHeight\/2);\n\t\tcurveVertex(width\/2 - headWidth\/2, height\/2 - headHeight\/2.15);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 - headHeight\/2.5);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 - headHeight\/3);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 - headHeight\/3.75);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 - headHeight\/4.5);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 - headHeight\/5.5);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 - headHeight\/7);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 - headHeight\/10);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 - headHeight\/16);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 - headHeight\/50);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 + headHeight\/50);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 + headHeight\/16);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 + headHeight\/10);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 + headHeight\/7);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 + headHeight\/5.5);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 + headHeight\/4.5);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 + headHeight\/3.75);\n\t\tcurveVertex(width\/2 - headWidth\/1.85, height\/2 + headHeight\/3);\n\t\tcurveVertex(width\/2 - headWidth\/1.9, height\/2 + headHeight\/2.5);\n\t\tcurveVertex(width\/2 - headWidth\/2, height\/2 + headHeight\/3);\n\t\tcurveVertex(width\/2 - headWidth\/2.1, height\/2 + headHeight\/3.75);\n\t\tcurveVertex(width\/2 - headWidth\/2.07, height\/2 + headHeight\/4.5);\n\t\tcurveVertex(width\/2 - headWidth\/2.11, height\/2 + headHeight\/5.5);\n\t\tcurveVertex(width\/2 - headWidth\/2.08, height\/2 + headHeight\/7);\n\t\tcurveVertex(width\/2 - headWidth\/2, height\/2);\n\t\tcurveVertex(width\/2 - headWidth\/2.2, height\/2 - headHeight\/5);\n\t\tcurveVertex(width\/2 - headWidth\/2.6, height\/2 - headHeight\/3);\n\t\tcurveVertex(width\/2 - headWidth\/2.7, height\/2 - headHeight\/2.75);\n\t\tcurveVertex(width\/2 - headWidth\/2.8, height\/2 - headHeight\/2.65);\n\t\tcurveVertex(width\/2 - headWidth\/3, height\/2 - headHeight\/2.65);\n\t\tcurveVertex(width\/2 - headWidth\/3, height\/2 - headHeight\/2.65);\n\t\tendShape();\n\t\t\/\/right pony\n\t\tbeginShape();\n\t\tcurveVertex(width\/2 + headWidth\/4.5, height\/2 - headHeight\/3);\n\t\tcurveVertex(width\/2 + headWidth\/4.5, height\/2 - headHeight\/2.25);\n\t\tcurveVertex(width\/2 + headWidth\/3.5, height\/2 - headHeight\/2);\n\t\tcurveVertex(width\/2 + headWidth\/2.5, height\/2 - headHeight\/2);\n\t\tcurveVertex(width\/2 + headWidth\/2, height\/2 - headHeight\/2.15);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 - headHeight\/2.5);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 - headHeight\/3);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 - headHeight\/3.75);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 - headHeight\/4.5);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 - headHeight\/5.5);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 - headHeight\/7);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 - headHeight\/10);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 - headHeight\/16);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 - headHeight\/50);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 + headHeight\/50);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 + headHeight\/16);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 + headHeight\/10);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 + headHeight\/7);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 + headHeight\/5.5);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 + headHeight\/4.5);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 + headHeight\/3.75);\n\t\tcurveVertex(width\/2 + headWidth\/1.85, height\/2 + headHeight\/3);\n\t\tcurveVertex(width\/2 + headWidth\/1.9, height\/2 + headHeight\/2.5);\n\t\tcurveVertex(width\/2 + headWidth\/2, height\/2 + headHeight\/3);\n\t\tcurveVertex(width\/2 + headWidth\/2.1, height\/2 + headHeight\/3.75);\n\t\tcurveVertex(width\/2 + headWidth\/2.07, height\/2 + headHeight\/4.5);\n\t\tcurveVertex(width\/2 + headWidth\/2.11, height\/2 + headHeight\/5.5);\n\t\tcurveVertex(width\/2 + headWidth\/2.08, height\/2 + headHeight\/7);\n\t\tcurveVertex(width\/2 + headWidth\/2, height\/2);\n\t\tcurveVertex(width\/2 + headWidth\/2.2, height\/2 - headHeight\/5);\n\t\tcurveVertex(width\/2 + headWidth\/2.6, height\/2 - headHeight\/3);\n\t\tcurveVertex(width\/2 + headWidth\/2.7, height\/2 - headHeight\/2.75);\n\t\tcurveVertex(width\/2 + headWidth\/2.8, height\/2 - headHeight\/2.65);\n\t\tcurveVertex(width\/2 + headWidth\/3, height\/2 - headHeight\/2.65);\n\t\tcurveVertex(width\/2 + headWidth\/3, height\/2 - headHeight\/2.65);\n\t\tendShape();\n\t\t\/\/hairline:\n    \t\tnoFill();\n\t\t\tstrokeWeight(5);\n    \tarc(width\/2, height\/2, headWidth, headHeight, PI, 0);\n\t\t\tstrokeWeight(10);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/50, headHeight - headHeight\/50, PI+QUARTER_PI\/4, -QUARTER_PI\/4);\n\t\t\tstrokeWeight(15);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/40, headHeight - headHeight\/40, PI+QUARTER_PI\/2, -QUARTER_PI\/2);\n\t\t\tstrokeWeight(20);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/20, headHeight - headHeight\/20, PI+QUARTER_PI\/2+QUARTER_PI\/4, -(QUARTER_PI\/2+QUARTER_PI\/4));\n\t\t\tstrokeWeight(25);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/10, headHeight - headHeight\/10, PI+QUARTER_PI, -QUARTER_PI);\n\t\t\tstrokeWeight(25);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/6, headHeight - headHeight\/5, PI+QUARTER_PI+QUARTER_PI\/4, -(QUARTER_PI+QUARTER_PI\/4));\n\t\t\tstrokeWeight(50);\n    \tarc(width\/2, height\/2 - headHeight\/2, headWidth - headWidth\/5, headHeight\/3, QUARTER_PI, PI - QUARTER_PI);\n\t} else if (hairStyle &lt;= 2) {\n\t\t\/\/HAIRSTYLE 2:\n\t    ellipse(width\/2 + 20, height\/2 - headHeight\/2, headWidth\/2, headHeight\/3);\n    \t\tnoFill();\n\t\t\tstrokeWeight(5);\n    \tarc(width\/2, height\/2, headWidth, headHeight, PI, 0);\n\t\t\tstrokeWeight(10);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/50, headHeight - headHeight\/50, PI+QUARTER_PI\/4, -QUARTER_PI\/4);\n\t\t\tstrokeWeight(15);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/40, headHeight - headHeight\/40, PI+QUARTER_PI\/2, -QUARTER_PI\/2);\n\t\t\tstrokeWeight(20);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/20, headHeight - headHeight\/20, PI+QUARTER_PI\/2+QUARTER_PI\/4, -(QUARTER_PI\/2+QUARTER_PI\/4));\n\t\t\tstrokeWeight(25);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/10, headHeight - headHeight\/10, PI+QUARTER_PI, -QUARTER_PI);\n\t\t\tstrokeWeight(25);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/6, headHeight - headHeight\/5, PI+QUARTER_PI+QUARTER_PI\/4, -(QUARTER_PI+QUARTER_PI\/4));\n\t\t\tstrokeWeight(50);\n    \tarc(width\/2, height\/2 - headHeight\/2, headWidth - headWidth\/5, headHeight\/3, QUARTER_PI, PI - QUARTER_PI);\n\t} else {\n\t\t\/\/HAIRSTYLE 3:\n\t\t\tnoFill();\n\t\t\tstrokeWeight(5);\n    \tarc(width\/2, height\/2, headWidth, headHeight, PI, 0);\n\t\t\tstrokeWeight(10);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/50, headHeight - headHeight\/50, PI+QUARTER_PI\/4, -QUARTER_PI\/4);\n\t\t\tstrokeWeight(15);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/40, headHeight - headHeight\/40, PI+QUARTER_PI\/2, -QUARTER_PI\/2);\n\t\t\tstrokeWeight(20);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/20, headHeight - headHeight\/20, PI+QUARTER_PI\/2+QUARTER_PI\/4, -(QUARTER_PI\/2+QUARTER_PI\/4));\n\t\t\tstrokeWeight(25);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/10, headHeight - headHeight\/10, PI+QUARTER_PI, -QUARTER_PI);\n\t\t\tstrokeWeight(25);\n    \tarc(width\/2, height\/2, headWidth - headWidth\/6, headHeight - headHeight\/5, PI+QUARTER_PI+QUARTER_PI\/4, -(QUARTER_PI+QUARTER_PI\/4));\n\t\t\tstrokeWeight(50);\n    \tarc(width\/2, height\/2 - headHeight\/2, headWidth - headWidth\/5, headHeight\/3, QUARTER_PI, PI - QUARTER_PI);\n\t}\n}\n\nfunction mousePressed() {\n\t\/\/HEAD:\n    headWidth = random(width\/2 - 30, width\/2 + 30);\n    headHeight = random(height\/2 - 20, height\/2 + 70);\n\t\/\/SKIN:\n    skinTone = random(0, 5);\n\t\/\/EYES:\n    eyeWidth = random(40, 65);\n    eyeHeight = random(15, 37);\n    eyeSpread = random(10, 15);\n    eyeColor = random(0, 4);\n\t\/\/NOSE:\n    noseSpread = random(57, 67);\n\tnoseWidth = random(5, 20);\n\tnoseHeight = random(55, 65);\n\t\/\/MOUTH:\n\tlipColor = random(0, 5);\n\tmouthHeight = random(5*height\/8 - 15, 5*height\/8 + 15);\n\tmouthShape = random(2);\n\t\/\/HAIR:\n\thairColor = random(7);\n\thairStyle = random(3);\n}\n<\/code><\/pre><\/div>\n\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>kstargio proj2 Download \/\/ Katherine Stargiotti, kstargio, B \/\/ PORTRAIT VARIABLES: \/\/HEAD: var headWidth = 640\/2 &#8211; 10; var headHeight = 840\/1.75 &#8211; 10; \/\/SKIN: var skinTone = 3; \/\/EYES: var eyeWidth = 55; \/\/(40, 65) var eyeHeight = 30; \/\/(15, 35) var eyeSpread = 12; \/\/(10, 15) var eyeColor = 1; \/\/(1, 4) var &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/11\/project-2-variable-faces-13\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 2: Variable Faces&#8221;<\/span><\/a><\/p>\n","protected":false},"author":673,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/65695"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/users\/673"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=65695"}],"version-history":[{"count":6,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/65695\/revisions"}],"predecessor-version":[{"id":65711,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/65695\/revisions\/65711"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=65695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=65695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=65695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}