{"id":66459,"date":"2021-09-25T22:59:46","date_gmt":"2021-09-26T02:59:46","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66459"},"modified":"2021-09-25T23:00:07","modified_gmt":"2021-09-26T03:00:07","slug":"project-04-string-art-5","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/25\/project-04-string-art-5\/","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 class=\"wp-block-file\"><a class=\"p5_sketch_link\" data-width=\"400\" data-height=\"300\" data-fontsize=\"9\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-174.js\">sketch-beans<\/a><a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-174.js\" class=\"wp-block-file__button\" download>Download<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"400\" height=\"300\"><\/iframe><pre class=\"language-javascript\" style=\"font-size:9px !important; line-height:13.05px !important\"><code class=\"p5_editor language-javascript\" style=\"font-size:9px !important;\">\/\/Yeon Lee, Section C\n\/\/Project-04: String Art\n\nvar dx1;\nvar dy1;\nvar dx2;\nvar dy2;\nvar dx3;\nvar dy3;\nvar numOfLines = 50;\nvar angle = 0;\n\nfunction setup() {\n    createCanvas(400, 300);\n    background(244, 226, 116);\n    dx = width \/ numOfLines;\n    dy = height \/ numOfLines;    \n    dx2 = 100 \/ numOfLines;\n    dy2 = 200 \/ numOfLines;    \n    dx3 = -100 \/ numOfLines;\n    dy3 = -200 \/ numOfLines;\n}\n\nfunction draw() {\n    var x1 = 0;\n    var y1 = 0;\n    var x2 = 0;\n    var y2 = height;\n    var x3 = 0;\n    var y3 = 0;\n    var x4 = width;\n    var y4 = 0;\n    var x5 = 0;\n    var y5 = 0;\n    var x6 = 0;\n    var y6 = height \/ 3;    \n    var x7 = width;\n    var y7 = 0;\n    var x8 = 0;\n    var y8 = 0;    \n    var x9 = 300;\n    var y9 = 0;\n    var x10 = 400;\n    var y10 = 300;\n    var x11 = 300;\n    var y11 = 400;\n    var x12 = 400;\n    var y12 = 300;\n\n    \/\/draw torquoise lines on the left bottom\n    for (var i = 0; i &lt;= numOfLines; i ++) {\n        stroke(123, 169, 147);\n        line(x1, y1, x2, y2);\n        y1 += dy;\n        x2 += dx;\n    }\n\n    \/\/draw pink lines on top right in the very back\n    for (var i = 0; i &lt;= numOfLines; i ++) {\n        stroke(240,192,165);\n        line(x3, y3, x4, y4);\n        x3 += dx2;\n        y4 += dy2;\n    }    \n\n    \/\/draw purple lines on the left\n    for (var i = 0; i &lt;= numOfLines; i ++) { \n        stroke(177, 131, 222);\n        line(x5, y5, x6, y6);\n        x5 += dx2;\n        y6 += dy2;\n    }\n\n    \/\/draw light orange lines in the back\n    for (var i = 0; i &lt;= numOfLines; i ++) { \n        stroke(255, 195, 153);\n        line(x7, y7, x8, y8);\n        x7 += dx2;\n        y8 += dy2;\n    }    \n\n    \/\/draw light yellow lines in the back\n    for (var i = 0; i &lt;= numOfLines; i ++) {\n        stroke(255,245,153);\n        line(x7, y7, x8, y8);\n        x7 += dx2;\n        y8 += dy2;\n    }    \n\n    \/\/draw light green lines on top right\n    for (var i = 0; i &lt;= numOfLines; i += 1) {\n        stroke(127, 255, 180);\n        line(x9, y9, x10, y10);\n        x9 += dx3;\n        y10 += dy3;\n    }\n\n    \/\/draw blue lines on bottom right\n    for (var i = 0; i &lt;= numOfLines; i ++) {\n        stroke(102,116,255);\n        line(x11, y11, x12, y12);\n        x11 += dx3;\n        y12 += dy3;\n    }\n\n    noLoop();\n}<\/code><\/pre><\/div>\n\n\n\n<p>I enjoyed playing around with variables to change the colors and shapes of the lines around. By overlapping lines on top of each other, one by one, I loved to mixture of colors and harmony it created among themselves. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I enjoyed playing around with variables to change the colors and shapes of the lines around. By overlapping lines on top of each other, one by one, I loved to mixture of colors and harmony it created among themselves.<\/p>\n","protected":false},"author":630,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,57],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66459"}],"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\/630"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66459"}],"version-history":[{"count":3,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66459\/revisions"}],"predecessor-version":[{"id":66468,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66459\/revisions\/66468"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}