{"id":71216,"date":"2022-09-10T19:21:21","date_gmt":"2022-09-10T23:21:21","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=71216"},"modified":"2022-09-11T20:55:30","modified_gmt":"2022-09-12T00:55:30","slug":"project-02-5","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/10\/project-02-5\/","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>I started off using the baseline template for a generative face that was given. I then used multiple if else statements to randomize the use of the nose, round mouth, curved mouth, curved eyes, square eyes, and colors of the inner and outer shapes.<\/p>\n<p><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-227.js\" data-width=\"640\" data-height=\"480\">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\">\/\/ Sowang Kundeling Section C Project 02\n\nvar r = 141;\nvar g = 35;\nvar b = 173;\nvar r2 = 210;\nvar g2 = 250;\nvar b2 = 233;\nvar eyeColor = 0\nvar faceWidth = 250;\nvar faceHeight = 300;\nvar eyeSize = 25;\nvar mouthWidth = 15;\nvar mouthPosition = 240;\n \nfunction setup() {\n    createCanvas(640, 480);\n}\n \nfunction draw() {\n    background(166, 215, 227);\n    noStroke();\n\n    fill(r, g, b);\n    ellipse(width\/2, height\/2, faceWidth+130, faceWidth+130); \/\/ hair\n\n    if(faceHeight &lt;= 125) {\n        fill(r2, g2, b2);\n        ellipse(width \/ 2, height \/ 2, faceWidth*.5, faceHeight*1.5); \/\/ cross ellipses\n        ellipse(width \/ 2, height \/ 2, faceWidth*1.5, faceHeight*.5);\n    }   \n\n    fill(r2, g2, b2);\n    ellipse(width \/ 2, height \/ 2, faceWidth,  faceHeight); \/\/ face shape\n    var eyeLX = width \/ 2 - faceWidth \/ 4; \/\/ eye variables\n    var eyeRX = width \/ 2 + faceWidth \/ 4;\n\n    \n    if(r &lt;= 100) {\n        fill(eyeColor);\n        ellipse(eyeLX, (height \/ 2) - 5, eyeSize, eyeSize); \/\/ eye\n        ellipse(eyeRX, (height \/ 2) - 5, eyeSize, eyeSize);\n        fill(r2, g2, b2);\n        ellipse(eyeLX, height \/ 2, eyeSize, (eyeSize \/ 2) + 9); \/\/ under eye shape to make arc\n        ellipse(eyeRX, height \/ 2, eyeSize, (eyeSize \/ 2) + 9);\n    } else {\n        fill(eyeColor);\n        rect(eyeLX -8, (height \/ 2) - 13, eyeSize\/2, eyeSize\/2); \/\/ square eye\n        rect(eyeRX -8, (height \/ 2) - 13, eyeSize\/2, eyeSize\/2);\n    }\n\n    if(eyeColor &lt;= 50) {\n        fill(eyeColor);\n        ellipse(width \/ 2, mouthPosition + 30, mouthWidth, mouthWidth); \/\/ round mouth\n    } else {\n        fill(eyeColor)\n        ellipse(width \/ 2, mouthPosition + 30, mouthWidth + 5, mouthWidth); \/\/ arc mouth\n        fill(r2, g2, b2);\n        ellipse(width \/ 2, mouthPosition + 25, mouthWidth + 8 , mouthWidth +3); \/\/ shape to make arc\n    }\n\n    if(mouthPosition &gt;= 240) { \/\/ nose\n        fill(eyeColor);\n        triangle(width\/2, height\/2, width\/2 + 8, height\/2 + 18, width\/2 - 8, height\/2 + 18);\n    }\n}\n \nfunction mousePressed() {\n    r = random(0, 199);\n    g = random(0, 199);\n    b = random(0, 199);\n    r2 = random(200, 255);\n    g2 = random(200, 255);\n    b2 = random(200, 255);\n    eyeColor = random(0, 100);\n    faceWidth = random(75, 150);\n    faceHeight = random(100, 150);\n    eyeSize = random(20, 35);\n    mouthWidth = random(10, 25);\n    mouthPosition = random(220, 250);\n}<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I started off using the baseline template for a generative face that was given. I then used multiple if else statements to randomize the use of the nose, round mouth, curved mouth, curved eyes, square eyes, and colors of the inner and outer shapes. sketch \/\/ Sowang Kundeling Section C Project 02 var r = &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/10\/project-02-5\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project-02&#8221;<\/span><\/a><\/p>\n","protected":false},"author":731,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[97,57],"tags":[23,61],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71216"}],"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\/731"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=71216"}],"version-history":[{"count":11,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71216\/revisions"}],"predecessor-version":[{"id":71619,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71216\/revisions\/71619"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=71216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=71216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=71216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}