{"id":66272,"date":"2021-09-19T23:22:07","date_gmt":"2021-09-20T03:22:07","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66272"},"modified":"2021-09-19T23:22:07","modified_gmt":"2021-09-20T03:22:07","slug":"project-3-dynamic-drawing-17","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/19\/project-3-dynamic-drawing-17\/","title":{"rendered":"Project 3: Dynamic Drawing"},"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>sketch<\/a><a class=\"p5_sketch_link\" data-width=\"300\" data-height=\"300\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-159.js\" download>Download<\/a>\n\n\n\n<iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"300\" height=\"300\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">function setup() {\n    createCanvas(600, 450);\n}\n\nfunction draw() {\n    background(79, 88, 161); \/\/dark blue\n    noStroke();\n    fill(252, 243, 199); \/\/light yellow\n    ellipse(300, 225, 100, 100); \/\/main center circle\n\n    \/\/ restricing the x and y coords of the mouse\n    var x = max(min(mouseX, 600), 0);\n    var y = max(min(mouseY, 450), 0);\n    var d = dist(x, y, 300, 225);\n    var size = 60 - 0.16 * d;\n\n    fill(255 - 0.65 * d, 204, 204); \/\/pink   \n\n    ellipse(300, 150 - 0.5 * d, size, size); \/\/circles in clockwise order\n    ellipse(350 + 0.5 * d, 170 - 0.5 * d, size, size);\n    ellipse(375 + 0.5 * d, 217, size, size);\n    ellipse(362 + 0.5 * d, 267 + 0.5 * d, size, size);\n    ellipse(320 + 0.1 * d, 297 + 0.5 * d, size, size);\n    ellipse(268 - 0.3 * d, 293 + 0.5 * d, size, size);\n    ellipse(232 - 0.6 * d, 257 + 0.4 * d, size, size);\n    ellipse(228 - 0.5 * d, 205, size, size);\n    ellipse(255 - 0.5 * d, 165 - 0.5 * d, size, size);\n}\n\n\n<\/code><\/pre><\/p><p>I thought this project was really fun because I got to be super creative with it. The circles move away from the big circle when you move your cursor as well as the size and color. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketchDownload function setup() { createCanvas(600, 450); } function draw() { background(79, 88, 161); \/\/dark blue noStroke(); fill(252, 243, 199); \/\/light yellow ellipse(300, 225, 100, 100); \/\/main center circle \/\/ restricing the x and y coords of the mouse var x = max(min(mouseX, 600), 0); var y = max(min(mouseY, 450), 0); var d = dist(x, y, &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/19\/project-3-dynamic-drawing-17\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 3: Dynamic Drawing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":643,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[100,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66272"}],"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\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66272"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66272\/revisions"}],"predecessor-version":[{"id":66277,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66272\/revisions\/66277"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}