{"id":66004,"date":"2021-09-18T16:36:07","date_gmt":"2021-09-18T20:36:07","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66004"},"modified":"2021-09-18T16:36:07","modified_gmt":"2021-09-18T20:36:07","slug":"project-3-dynamic-drawing-5","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/18\/project-3-dynamic-drawing-5\/","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 class=\"p5_sketch_link\" data-width=\"600\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-134.js\">luca p3<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"600\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">var bs = 50\/\/boxsize\nvar bv = 5\/\/boxspeed\nvar bx = 300\/\/box x position\nvar by = 200\/\/box y position\nvar an = 180\/\/box angle\n\nfunction setup() {\n    createCanvas(600, 450);\n    background(254, 250, 224);\n    rectMode(CENTER)\n    frameRate(100)\n    noStroke();\n}\n\n\/\/background\nfunction draw(){\n\n    rotate(radians(an));\n    an=an+50;\n\n    function mousePressed(){\n        an=an-50\n    }\n\n    \/\/colorchange\n    if(mouseX&lt;width\/2 & mouseY<height\/2)\n        fill(3, 7, 30);\n    if(mouseX&gt;width\/2 & mouseY<height\/2)\n        fill(157, 2, 8);\n    if(mouseX&gt;width\/2 & mouseY>height\/2)\n        fill(220, 47, 2);\n    if(mouseX&lt;width\/2 & mouseY>height\/2)\n        fill(250, 163, 7);\n\n    rect(bx,by,bs,bs);\n\n    if(mouseX & mouseY >= 600 || mouseY && mouseX >= 450)\n        bs=bs+0.1;\n\n\n}\n\n\n\n\n\n\n<\/code><\/pre><\/p>\n\n\n\n<p>I find this project quite challenging because we have a lot more variables to consider. I think it was easy to create an interaction that is totally random but it was difficult to create an interaction that was consistent every time. Through this project, I learned more about coding with multiple variables. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>luca p3 var bs = 50\/\/boxsize var bv = 5\/\/boxspeed var bx = 300\/\/box x position var by = 200\/\/box y position var an = 180\/\/box angle function setup() { createCanvas(600, 450); background(254, 250, 224); rectMode(CENTER) frameRate(100) noStroke(); } \/\/background function draw(){ rotate(radians(an)); an=an+50; function mousePressed(){ an=an-50 } \/\/colorchange if(mouseX&lt;width\/2 &#038; mouseYheight\/2) fill(250, 163, 7); &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/18\/project-3-dynamic-drawing-5\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 3: Dynamic Drawing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":642,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66004"}],"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\/642"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66004"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66004\/revisions"}],"predecessor-version":[{"id":66011,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66004\/revisions\/66011"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}