{"id":70740,"date":"2022-09-09T15:06:24","date_gmt":"2022-09-09T19:06:24","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=70740"},"modified":"2022-09-09T15:06:24","modified_gmt":"2022-09-09T19:06:24","slug":"project-2-variable-faces","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/09\/project-2-variable-faces\/","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><p>I had a fun time planning out all the changing parts of these animal faces and figuring out how to use color type variables for fur tone was interesting!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"478\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/image-9-1024x478.png\" alt=\"\" class=\"wp-image-70748\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/image-9-1024x478.png 1024w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/image-9-300x140.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/image-9-768x359.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/image-9-1536x718.png 1536w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/image-9-1200x561.png 1200w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/image-9.png 1920w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><figcaption>Planning each variable feature<\/figcaption><\/figure><div class=\"wp-block-file\"><a class=\"p5_sketch_link\" data-width=\"640\" data-height=\"480\" id=\"wp-block-file--media-910f2855-bae4-423b-a307-58b59103ac62\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/isis-variable-faces.js\">variable animal faces<\/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\">\/\/ isis berymon section D\n\nfunction setup() {\n    createCanvas(640, 480);\n    frameRate(10);\n    background(245, 232, 215); \/\/biege\n}\n\nfunction draw() {\n}\n\nfunction mousePressed() {\n    background(245, 232, 215); \/\/biege\n    var face;\n\n    \/\/face color generator\n    if(random(3) &lt;= 1){\n        face = color(145, 191, 217); \/\/blue\n    } else if(random(3) &lt;= 2) {\n        face = color(181, 145, 217); \/\/purple\n    } else {\n        face = color(232, 149, 201); \/\/pink\n    }\n    \n     \/\/face\n    fill(face);\n    noStroke();\n    ellipse(width\/2, height\/2, 270, 250);\n    \/\/nose\n    fill(30);\n    ellipse(290, 270, 60, 50);\n    ellipse(350, 270, 60, 50);\n    fill(face);\n    ellipse(287, 265, 60, 50);\n    ellipse(353, 265, 60, 50);\n    fill(43, 34, 40);\n    triangle(320, 270, 310, 250, 330, 250);\n\n    \/\/ear generator\n    if(random(3) &lt;= 1){\n        \/\/cat ears\n        fill(face);\n        triangle(200, 190, 230, 80, 330, 200);\n        triangle(350, 190, 410, 80, 440, 200);\n    } else if(random(3) &lt;=2) {\n        \/\/dog ears\n        fill(face);\n        ellipse(250, 150, 80, 120);\n        ellipse(390, 150, 80, 120);\n    } else {\n        \/\/bunny ears\n        fill(face);\n        ellipse(250, 150, 60, 200);\n        ellipse(390, 150, 60, 200);\n    }\n\n    \/\/neutral eyes\n        fill(30);\n        ellipse(260, 220, 60, 80);\n        ellipse(380, 220, 60, 80);\n        fill(200);\n        circle(250, 210, 30);\n        circle(370, 210, 30);\n\n    \/\/eye expression generator\n    if(random(3) &lt;= 1) {\n        \/\/happy eyes\n        fill(face);\n        ellipse(260, 260, 60, 30);\n        ellipse(380, 260, 60, 30);\n    } else if(random(3) &lt;=2) {\n        \/\/smug eyes\n        fill(face);\n        rect(230, 180, 60, 30);\n        rect(350, 180, 60, 30);\n    }\n}<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I had a fun time planning out all the changing parts of these animal faces and figuring out how to use color type variables for fur tone was interesting! variable animal faces \/\/ isis berymon section D function setup() { createCanvas(640, 480); frameRate(10); background(245, 232, 215); \/\/biege } function draw() { } function mousePressed() { &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/09\/project-2-variable-faces\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;project 2: variable faces&#8221;<\/span><\/a><\/p>\n","protected":false},"author":703,"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\/f2022\/wp-json\/wp\/v2\/posts\/70740"}],"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\/703"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=70740"}],"version-history":[{"count":3,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/70740\/revisions"}],"predecessor-version":[{"id":70749,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/70740\/revisions\/70749"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=70740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=70740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=70740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}