{"id":73048,"date":"2022-09-25T17:23:13","date_gmt":"2022-09-25T21:23:13","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73048"},"modified":"2022-09-25T17:33:05","modified_gmt":"2022-09-25T21:33:05","slug":"project-03-dynamic-drawing-14","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/25\/project-03-dynamic-drawing-14\/","title":{"rendered":"Project 03 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>I wanted to play with the translate and rotation tools so I made this fun little spinning ellipse. <\/p>\n\n\n\n<div class=\"wp-block-file\"><a class=\"p5_sketch_link\" data-width=\"600\" data-height=\"450\" id=\"wp-block-file--media-98d02cac-c9a4-439e-bd1d-3ed4ecf497de\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-388.js\">sketch<\/a><a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-388.js\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-98d02cac-c9a4-439e-bd1d-3ed4ecf497de\">Download<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"600\" height=\"450\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/felix cooper fcooper d\n\nvar r=constrain(mouseX,-180,180);\nvar height=constrain(50,-255,255);\n\nfunction setup() {\n    createCanvas(600, 450);\n}\n\nfunction draw() {\n    background(0);\n    noStroke();\n    translate(300,225);\n    rotate(radians(r)); \/\/spins circle according to mousex\n    ellipse(80,0,50, height);\n    r=mouseX;\n\n    if(mouseY&lt;225){ \/\/changes ellipse length based on mousey\n        height=height+5;\n    }\n    else{\n        height=height-5;\n    }\n    fill(height); \/\/changes gradient based on how small it is - will dissapear\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to play with the translate and rotation tools so I made this fun little spinning ellipse. sketchDownload \/\/felix cooper fcooper d var r=constrain(mouseX,-180,180); var height=constrain(50,-255,255); function setup() { createCanvas(600, 450); } function draw() { background(0); noStroke(); translate(300,225); rotate(radians(r)); \/\/spins circle according to mousex ellipse(80,0,50, height); r=mouseX; if(mouseY&lt;225){ \/\/changes ellipse length based on mousey &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/25\/project-03-dynamic-drawing-14\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 03 dynamic drawing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":713,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73048"}],"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\/713"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73048"}],"version-history":[{"count":3,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73048\/revisions"}],"predecessor-version":[{"id":73063,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73048\/revisions\/73063"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}