{"id":73183,"date":"2022-09-27T09:32:34","date_gmt":"2022-09-27T13:32:34","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73183"},"modified":"2022-09-27T09:32:58","modified_gmt":"2022-09-27T13:32:58","slug":"project-4-string-art-7","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/27\/project-4-string-art-7\/","title":{"rendered":"Project 4 &#8211; String Art"},"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>For this project, I wanted to test the variability of how string art can generate, so I made a random string generator that creates what eventually looks like TV static. Press down the mouse to generate more and more strings until the screen is completely covered!<\/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-648c2053-7021-4a92-9c6b-89f49f731ab3\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-401.js\">csavitz_4<\/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\">\/\/Cole Savitz-Vogel\n\/\/csavitzv\n\/\/Section A\n\nvar x1; \nvar y1;\nvar x2; \nvar y2;\nvar x3;\nvar y3;\nvar x4;\nvar y4;\nvar x5;\nvar y5;\nvar x6;\nvar y6;\n\nfunction setup() {\n    createCanvas(500, 500);\n    background(0);\n}\n\nfunction draw() {\n\n    if (mouseIsPressed){\n        strokeWeight(.5);\n        web();\n        push();\n        translate(random(0,500),random(0,500));\n        web();\n        pop();\n        push();\n        translate(random(0,500),random(0,500));\n        web();\n        pop();\n        push();\n    }\n}\n\nfunction web() {\n\n    x3 = random(1, 500);\n    y3 = random(1, 500);\n    x4 = random(1, 500);\n    y4 = random(1, 500);\n    x5 = random(1, 500);\n    y5 = random(1, 500);\n    x6 = random(1, 500);\n    y6 = random(1, 500);\n    x1 = x3; \n    y1 = y3;\n    x2 = x5;\n    y2 = y5;\n\n    line(x3, y3, x4, y4);\n    line(x5, y5, x6, y6);\n    strokeWeight(0.5);\n\n    for (var i = 0; i &lt; 51; i+=1) {\n\n        var xdelta1 = (x4 - x3);\n        var ydelta1 = (y4 - y3);\n        var xdelta2 = (x5 - x6);\n        var ydelta2 = (y5 - y6);\n        \n        noFill();\n        stroke(random(i,200), random(i,200), random(i,200));\n        arc(x1, y1, x2, y2, random(0,3), random(0,3));\n\n        x1 += xdelta1;\n        y1 += ydelta1;\n        x2 += xdelta2;\n        y2 += ydelta2;\n\n    }\n\n}<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>For this project, I wanted to test the variability of how string art can generate, so I made a random string generator that creates what eventually looks like TV static. Press down the mouse to generate more and more strings until the screen is completely covered! csavitz_4 \/\/Cole Savitz-Vogel \/\/csavitzv \/\/Section A var x1; var &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/27\/project-4-string-art-7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 4 &#8211; String Art&#8221;<\/span><\/a><\/p>\n","protected":false},"author":757,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,55],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73183"}],"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\/757"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73183"}],"version-history":[{"count":3,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73183\/revisions"}],"predecessor-version":[{"id":73187,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73183\/revisions\/73187"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}