{"id":65782,"date":"2021-09-12T21:54:46","date_gmt":"2021-09-13T01:54:46","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=65782"},"modified":"2021-09-12T21:56:15","modified_gmt":"2021-09-13T01:56:15","slug":"project-02-variable-faces-5","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/12\/project-02-variable-faces-5\/","title":{"rendered":"Project 02: 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><p><a class=\"p5_sketch_link\" data-width=\"700\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-117.js\">variable faces<\/a><a>\n\n\n\n<p> <\/p><\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"700\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">var eyeSize = 100;   \/\/Max Stockdale, section D\nvar faceWidth = 350;\nvar faceHeight = 250;\nvar mouth = 50;\nvar tooth=40;\nvar nose=60;\nvar eyeHighlight=20;\nvar body=400\nvar arms=100\n\nfunction setup() {\n    createCanvas(640, 480);\n    background(220);\n    text(\"p5.js vers 0.9.0 test.\", 10, 15);\n}\n\n \nfunction draw() {\n    background(91,161,191);  \/\/blue\n    strokeWeight(0);\n    fill(47,213,102);\n    circle(width\/2, height\/1.2, body); \/\/body shape\n    fill(255,255,255);\n    strokeWeight(0);\n    ellipse(width \/ 2, height \/ 2, faceWidth,  faceHeight); \/\/face\n    var eyeLX = width \/ 2 - faceWidth * 0.5;\n    var eyeRX = width \/ 2 + faceWidth * 0.5;\n    strokeWeight(1);\n    fill(0,0,0);\n    ellipse(eyeLX, height \/ 2, eyeSize, eyeSize);  \/\/left eye\n    ellipse(eyeRX, height \/ 2, eyeSize, eyeSize);  \/\/right eye\n    fill(255,255,255);\n    circle(eyeLX + 5, height \/ 2, eyeHighlight);  \/\/eye highlight\n    circle(eyeRX + 5, height \/ 2, eyeHighlight);  \/\/eye highlight\n    fill(48,56,65); \n    rect(width\/2, height\/2, mouth, mouth);  \/\/mouth\n    fill(255,255,255);\n    triangle(320,240, 330,250, 340,240);  \/\/tooth\n    fill(72,3,31);\n    ellipse(width\/2, height\/2.25, nose, 20); \/\/noser\n    strokeWeight(0);\n    fill(153,155,250);\n    circle(width\/4.75, height\/1.3, arms);  \/\/left arm\n    circle(width\/1.25, height\/1.3, arms);  \/\/right arm\n    fill(255,255,255);\n\n    \n\n\n\n\n}\n \nfunction mousePressed() {\n    faceWidth = random(50, 600);\n    faceHeight = random(150, 300);\n    eyeSize = random(20, 60);\n    mouth = random(10, 40);\n    ears = random(5,15);\n    nose = random(15,45);\n    body =random(400,500);\n    arms = random(80,120);\n}\n<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>variable faces var eyeSize = 100; \/\/Max Stockdale, section D var faceWidth = 350; var faceHeight = 250; var mouth = 50; var tooth=40; var nose=60; var eyeHighlight=20; var body=400 var arms=100 function setup() { createCanvas(640, 480); background(220); text(&#8220;p5.js vers 0.9.0 test.&#8221;, 10, 15); } function draw() { background(91,161,191); \/\/blue strokeWeight(0); fill(47,213,102); circle(width\/2, height\/1.2, body); &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/12\/project-02-variable-faces-5\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 02: Variable Faces&#8221;<\/span><\/a><\/p>\n","protected":false},"author":686,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[97,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/65782"}],"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\/686"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=65782"}],"version-history":[{"count":5,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/65782\/revisions"}],"predecessor-version":[{"id":65788,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/65782\/revisions\/65788"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=65782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=65782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=65782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}