{"id":71642,"date":"2022-09-11T23:30:00","date_gmt":"2022-09-12T03:30:00","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=71642"},"modified":"2022-09-11T23:21:24","modified_gmt":"2022-09-12T03:21:24","slug":"project-2-3","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/11\/project-2-3\/","title":{"rendered":"Project 2"},"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>Work to test out variable colour, ratio, shapes and size of facial features. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"772\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/project-2-img-1024x772.png\" alt=\"\" class=\"wp-image-71700\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/project-2-img-1024x772.png 1024w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/project-2-img-300x226.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/project-2-img-768x579.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/project-2-img-1200x905.png 1200w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/project-2-img.png 1300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><figcaption>Project 2 image<\/figcaption><\/figure><pre class=\"wp-block-code\"><code>\nvar eyeSize = 20;\nvar faceWidth = 110;\nvar faceHeight = 150;\nvar mouthWidth = 30;\nvar mouthHeighth = 10;\nvar earSize =30;\nvar bodyWidth =200;\nvar bodyHeight = 300;\nvar shirtColour= 90;\nvar faceTone= 220;\nvar eyeTone=115;\n \nfunction setup() {\n    createCanvas(640, 480);\n}\n \nfunction draw() {\n    background(180);\n    fill(208,223,250)\n    strokeWeight(0);\n    rect(0,0,640,200)\n    stroke(139,163,187);\n    strokeWeight(5);\n    line(0,200,640,200)\n\/\/background \n\n    strokeWeight(2);\n    stroke(22, 62, 104);\n    fill(11,31,shirtColour)\n    ellipse(width \/ 2, height \/ 1.10, bodyWidth,  bodyHeight);\n\/\/body \n\n    stroke(11, 31, 52);\n    fill(255,faceTone,faceTone)\n    var earLX = width \/ 1 - faceWidth * 1.5;\n    var earRX = width \/ 1 + faceWidth * 1.5;\n    ellipse(width\/2.4, height \/ 1.9, earSize, earSize);\n    ellipse(width\/1.7, height \/ 1.9, earSize, earSize);\n\/\/ear\n\n    strokeWeight(2);\n    stroke(11, 31, 52);\n    fill(255,faceTone,faceTone)\n    ellipse(width \/ 2, height \/ 2, faceWidth,  faceHeight);\n    noFill();\n    var eyeLX = width \/ 2 - faceWidth * 0.25;\n    var eyeRX = width \/ 2 + faceWidth * 0.25;\n    fill(eyeTone,80,30)\n    ellipse(eyeLX, height \/ 2, eyeSize, eyeSize);\n    ellipse(eyeRX, height \/ 2, eyeSize, eyeSize);\n\/\/face and eye\n\n    fill(255,140,85)\n    square(width \/ 2.09, height \/ 1.9, mouthWidth);\n    var mouth = width \/ 1.1 - faceWidth * 0.5;\n\/\/mouth\n}\n \nfunction mousePressed() {\n    \/\/ when the user clicks, these variables are reassigned\n    \/\/ to random values within specified ranges. For example,\n    \/\/ 'faceWidth' gets a random value between 75 and 150.\n    faceWidth = random(100, 145);\n    faceHeight = random(120, 200);\n    eyeSize = random(10, 28);\n    mouthWidth = random(20,30);\n    mouthHeighth = random(5,15);\n    earSize= random(25,40);\n    bodyWidth= random(200,300);\n    bodyHeight= random(300,370);\n    shirtColour= random (20,350);\n    faceTone= random (190,225);\n    eyeTone= random (70,150);\n}<\/code><\/pre><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Work to test out variable colour, ratio, shapes and size of facial features.<\/p>\n","protected":false},"author":700,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[97],"tags":[81],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71642"}],"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\/700"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=71642"}],"version-history":[{"count":5,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71642\/revisions"}],"predecessor-version":[{"id":71701,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/71642\/revisions\/71701"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=71642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=71642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=71642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}