{"id":66689,"date":"2021-09-27T11:12:06","date_gmt":"2021-09-27T15:12:06","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66689"},"modified":"2021-09-27T11:12:06","modified_gmt":"2021-09-27T15:12:06","slug":"project-04-string-art-16","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/27\/project-04-string-art-16\/","title":{"rendered":"Project 04: 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><div><a class=\"p5_sketch_link\" data-width=\"300\" data-height=\"400\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-202.js\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"300\" height=\"400\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Julianna Bolivar\n\/\/jbolivar\n\/\/Section D\n\/\/Program: String Art\n\n\nvar dx1;\nvar dy1;\nvar dx2;\nvar dy2;\n\nvar dx3;\nvar dy3;\nvar dx4;\nvar dy4; \n\nvar dx5;\nvar dy5;\nvar dx6;\nvar dy6; \n\n\n\nvar numLines = 50;\n\nfunction setup() {\n    createCanvas(300, 400);\n    background(244, 235, 232);\n    \/\/hot pink\n    stroke(222, 49, 99);\n    \/\/right most lines\n    line(300, 300, 350, 300); \n    dx1 = (250)\/numLines;\n    dy1 = (290)\/numLines;\n    dx2 = (100)\/numLines;\n    dy2 = (290)\/numLines;\n    \/\/left most lines\n    dx3 = (150)\/numLines;\n    dy3 = (320)\/numLines;\n    dx4 = (90)\/numLines;\n    dy4 = (90)\/numLines;\n    \/\/overlapping lines\n    dx5 = (150)\/numLines;\n    dy5 = (320)\/numLines;\n    dx6 = (90)\/numLines;\n    dy6 = (90)\/numLines;\n}\n\nfunction draw() {\n    \/\/right most lines\n    var x1 = 50;\n    var y1 = 10;\n    var x2 = 200;\n    var y2 = 200;\n    \/\/left most lines\n    var x3 = 0;\n    var y3 = 200;\n    var x4 = 220;\n    var y4 = 350;\n    \/\/overlapping lines\n    var x5 = 40;\n    var y5 = 200;\n    var x6 = 220;\n    var y6 = 350;\n\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        line(x1, y1, x2, y2);\n        line(x3, y3, x4, y4);\n        line(x5, y5, x6, y6);\n\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n\n        x3 -= dx3;\n        y3 -= dy3;\n        x4 += dx4;\n        y4 += dy4;\n\n        x5 -= dx5;\n        y5 -= dy5;\n        x6 += dx6;\n        y6 += dy6;   \n    }\n\n    noLoop();\n}\n\n\n<\/code><\/pre><\/div>\n\n\n\n<p>Mine is quite simple, I wanted to have an interaction or at least have a variety of colors but I couldn&rsquo;t get it to work in time. I knew I wanted the strings to work vertically, and the overlapping strings was a mistake I ended up liking.<\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Mine is quite simple, I wanted to have an interaction or at least have a variety of colors but I couldn&rsquo;t get it to work in time. I knew I wanted the strings to work vertically, and the overlapping strings was a mistake I ended up liking.<\/p>\n","protected":false},"author":640,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66689"}],"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\/640"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66689"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66689\/revisions"}],"predecessor-version":[{"id":66692,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66689\/revisions\/66692"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}