{"id":72061,"date":"2022-09-17T17:30:15","date_gmt":"2022-09-17T21:30:15","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=72061"},"modified":"2022-09-24T11:28:37","modified_gmt":"2022-09-24T15:28:37","slug":"project-03-dynamic-drawing-6","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/17\/project-03-dynamic-drawing-6\/","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><ol><li>Size of large circle changes<\/li><li>Shade of large circle changes<\/li><li>Rotation of smaller circle changes <\/li><li>Stroke of smaller circles changes <\/li><\/ol><p><a class=\"p5_sketch_link\" data-width=\"600\" data-height=\"450\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-276.js\"><\/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\">var uniX = 0;\nvar uniY = 0;\n\n\nfunction setup() {\n    createCanvas(600, 450);\n    background(0);\n}\n\nfunction draw() {\n    uniX = mouseX;\n    uniY = mouseY;\n    background(0);\n    push();\n    fill(255);\n    ellipse (uniX,uniY,200);\n    pop();\n    for (let i = 25; i &lt;= 575; i+=50)\n    {\n        for (let j = 25; j &lt;= 425; j+=50)\n        {\n            circleChange(i,j);\n        }\n    }\n}\n\nfunction circleChange(Cx,Cy) {\n    distanceO = Math.sqrt((uniX-Cx)*(uniX-Cx) + (uniY-Cy)*(uniY-Cy));\n    distance = constrain(distanceO, 10, 200);\n    var diameter = distance\/4;\n    var angle = Math.atan2((uniY-Cy),(uniX-Cx));\n    push();\n    strokeWeight(1);\n    stroke(0,0,255,255);\n    noFill();\n    arc(Cx, Cy, diameter, diameter, -0.25*PI, 0.75*PI);\n    pop();\n    push();\n    strokeWeight(1);\n    stroke(255,0,0,255);\n    arc(Cx, Cy, diameter, diameter, 0.75*PI, 1.75*PI);\n    pop();\n\n    push();\n    strokeWeight(0);\n    fill(distance\/200*255);\n    ellipse (Cx,Cy,diameter-2);\n    pop();\n\n    fill(255);\n    strokeWeight(distanceO\/60);\n    ellipse((Cx+diameter*Math.cos(angle)\/3),(Cy+diameter*Math.sin(angle)\/3),diameter\/3);\n\n}\n\n<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Size of large circle changes Shade of large circle changes Rotation of smaller circle changes Stroke of smaller circles changes var uniX = 0; var uniY = 0; function setup() { createCanvas(600, 450); background(0); } function draw() { uniX = mouseX; uniY = mouseY; background(0); push(); fill(255); ellipse (uniX,uniY,200); pop(); for (let i = 25; &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/17\/project-03-dynamic-drawing-6\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 03: Dynamic Drawing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":768,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[100,55,1],"tags":[125,79],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72061"}],"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\/768"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=72061"}],"version-history":[{"count":6,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72061\/revisions"}],"predecessor-version":[{"id":72646,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72061\/revisions\/72646"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=72061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=72061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=72061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}