{"id":72181,"date":"2022-09-17T22:25:16","date_gmt":"2022-09-18T02:25:16","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=72181"},"modified":"2022-09-17T22:25:16","modified_gmt":"2022-09-18T02:25:16","slug":"project-3-dynamic-drawing-2","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/17\/project-3-dynamic-drawing-2\/","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>I really wanted to make something that incorporated color changes without using a lot of colors. So I messed around with blend modes and created this!<\/p>\n\n\n\n<div class=\"wp-block-file\"><a class=\"p5_sketch_link\" data-width=\"500\" data-height=\"500\" id=\"wp-block-file--media-bca3ff47-77ae-4d5c-ba8f-7919b528b6a1\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-293.js\">isis-dynamic<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"500\" height=\"500\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ isis berymon section D\n\nvar x;\nvar y;\nvar bluex;\nvar bluey;\nvar greenx;\nvar greeny;\nvar d;\n\nfunction setup() {\n    createCanvas(500,500);\n    background(0);\n    d = 100;\n    bluex = width\/2;\n    bluey = height\/2;\n    greenx = width\/2;\n    greeny = height\/2;\n}\n\nfunction draw() {\n    blendMode(BLEND); \/\/makes bg opaque\n    background(0);\n    blendMode(SCREEN); \/\/brightens overlapping colors\n    fill(255,0,0);\n    circle(width\/2, height\/2, d);\n    fill(0,255,0);\n    circle(greenx, greeny, d);\n    fill(0,0,255);\n    circle(bluex, bluey, d);\n    \/\/diameter scales with how far mouse is from center\n    d = width\/2-dist(width\/2, height\/2, mouseX, mouseY);\n    \/\/blue circle moves opposite the mouse\n    bluex = width\/2 + (width\/2-mouseX);\n    bluey = height\/2 + (height\/2-mouseY);\n    \/\/green circle moves with the mouse\n    greenx = width\/2 + (mouseX-width\/2);\n    greeny = height\/2 + (mouseY-height\/2);\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I really wanted to make something that incorporated color changes without using a lot of colors. So I messed around with blend modes and created this! isis-dynamic \/\/ isis berymon section D var x; var y; var bluex; var bluey; var greenx; var greeny; var d; function setup() { createCanvas(500,500); background(0); d = 100; bluex &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/17\/project-3-dynamic-drawing-2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;project 3: dynamic drawing&#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":[100,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72181"}],"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=72181"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72181\/revisions"}],"predecessor-version":[{"id":72184,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72181\/revisions\/72184"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=72181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=72181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=72181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}