{"id":71142,"date":"2022-09-10T18:42:42","date_gmt":"2022-09-10T22:42:42","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=71142"},"modified":"2022-09-10T18:42:42","modified_gmt":"2022-09-10T22:42:42","slug":"project-02-4","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/10\/project-02-4\/","title":{"rendered":"Project-02"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p>Here is my changing face! I think I struggled the most with deciding what nostril shape I wanted, as well as whether I wanted the eyebrows to be downturned (making them angry) or flat. I decided on flat, so that the face could smile.<\/p>\n\n\n\n<p><a class=\"p5_sketch_link\" data-width=\"640\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-161.js\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"640\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ Amanda Wen Section C\n\nvar eyeSizeW = 50\nvar eyeSizeH = 70\nvar pupilSizeW = 20\nvar pupilSizeH = 30\nvar faceWidth = 180\nvar faceHeight = 150\nvar noseWidth = 5\nvar noseHeight = 3\nvar eyebrowWidth = 30\nvar eyebrowHeight = 10\n\nvar skinR = 60\nvar skinG = 137\nvar skinB = 97\n\nvar eyeR = 144\nvar eyeG = 185\nvar eyeB = 147\n\nvar pupilR = 34\nvar pupilG = 83\nvar pupilB = 75\n\nvar eyebrowR = 22\nvar eyebrowG = 59\nvar eyebrowB = 34\n\nvar noseR = 22\nvar noseG = 59\nvar noseB = 34\n\nvar mouthR = 186\nvar mouthG = 202\nvar mouthB = 181\n\n\nfunction setup() {\n    createCanvas(640, 480);\n    background(255);\n    text(\"p5.js vers 0.9.0 test.\", 10, 15);\n}\n\nfunction draw() {\n    background(58, 81, 78); \/\/ background color\n    noStroke();\n\/\/ face\n    fill(skinR, skinG, skinB); \/\/ face color\n    ellipse(width \/ 2, height \/ 2, faceWidth, faceHeight); \/\/ face shape\n\n\/\/ eyeballs\n    var eyeLX = width \/ 2 - faceWidth * 0.25;\n    var eyeRX = width \/ 2 + faceWidth * 0.25;\n    fill(eyeR, eyeG, eyeB); \/\/ eye color\n    ellipse(eyeLX, height \/ 2, eyeSizeW, eyeSizeH); \/\/ left eyeball\n    ellipse(eyeRX, height \/ 2, eyeSizeW, eyeSizeH); \/\/ right eyeball\n\n\/\/ pupils\n    var pupilLX = width \/ 2 - faceWidth * 0.25;\n    var pupilRX = width \/ 2 + faceWidth * 0.25;\n    fill(pupilR, pupilG, pupilB); \/\/ pupil color\n    ellipse(pupilLX, height \/ 2, pupilSizeW, pupilSizeH); \/\/ left pupil\n    ellipse(pupilRX, height \/ 2, pupilSizeW, pupilSizeH); \/\/ right pupil\n\n\/\/ eyebrows\n    var eyebrowLX = width \/ 2 - faceWidth * 0.35;\n    var eyebrowRX = width \/ 2 + faceWidth * 0.2;\n    fill(eyebrowR, eyebrowG, eyebrowB); \/\/ eyebrow color\n    rect(eyebrowLX, height \/ 2.5, eyebrowWidth, eyebrowHeight); \/\/ left eyebrow\n    rect(eyebrowRX, height \/ 2.5, eyebrowWidth, eyebrowHeight); \/\/ right eyebrow\n\n\/\/ nostrils\n    var noseLX = width \/ 2 - faceWidth * 0.05;\n    var noseRX = width \/ 2 + faceWidth* 0.03;\n    fill(noseR, noseG, noseB); \/\/ nose color\n    rect(noseLX, height \/ 1.8, noseWidth, noseHeight) \/\/ left nostril\n    rect(noseRX, height \/ 1.8, noseWidth, noseHeight) \/\/ left nostril\n\n\/\/ mouth\n    var mouth = width \/ 2 + faceWidth * 0.01;\n    fill(mouthR, mouthG, mouthB); \/\/ mouth color\n    arc(mouth, height * 0.6, 40, 20, radians(0), radians(180)); \/\/ mouth shape\n}\n\nfunction mousePressed() {\n    \/\/ face shape random\n    faceWidth = random(180, 150)\n    faceHeight = random(180, 150)\n    \/\/ eye shape random\n    eyeSizeW = random(50, 70);\n    eyeSizeH = random(50, 70);\n    \/\/ pupil shaperandom\n    pupilSizeH = random(20, 30);\n    pupilSizeW = random(20, 30);\n\n    \/\/ skin color random\n    skinR = random(180, 200);\n    skinG = random(180, 200);\n    skinB = random(180, 200);\n    \/\/ eye color random\n    eyeR = random(100, 160);\n    eyeG = random(100, 160);\n    eyeB = random(100, 160);\n    \/\/ pupil color random\n    pupilR = random(108, 90);\n    pupilG = random(108, 90);\n    pupilB = random(108, 90);\n    \/\/ eyebrow color random\n    eyebrowR = random(110, 103);\n    eyebrowG = random(110, 103);\n    eyebrowB = random(110, 103);\n    \/\/ nose color random\n    noseR = random(130, 200);\n    noseG = random(130, 200);\n    noseB = random(130, 200);\n    \/\/ mouth color\n    mouthR = random(120, 100);\n    mouthG = random(120, 100);\n    mouthB = random(120, 100);\n}\n \n<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Here is my changing face! I think I struggled the most with deciding what nostril shape I wanted, as well as whether I wanted the eyebrows to be downturned (making them angry) or flat. I decided on flat, so that the face could smile. sketch \/\/ Amanda Wen Section C var eyeSizeW = 50 var &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/10\/project-02-4\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project-02&#8221;<\/span><\/a><\/p>\n","protected":false},"author":771,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[97,57],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71142"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/771"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=71142"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71142\/revisions"}],"predecessor-version":[{"id":71182,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71142\/revisions\/71182"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=71142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=71142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=71142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}