{"id":66604,"date":"2021-09-26T22:16:49","date_gmt":"2021-09-27T02:16:49","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66604"},"modified":"2021-09-26T22:16:49","modified_gmt":"2021-09-27T02:16:49","slug":"project-4-string-art-8","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/26\/project-4-string-art-8\/","title":{"rendered":"Project 4: 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><meta charset=\"utf-8\"><\/p>\n\n\n\n<p><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-191.js\">luca string<\/a><a><\/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\">var dx1;\nvar dy1;\nvar dx2;\nvar dy2;\nvar dx3;\nvar dy3;\nvar numl = 40;\/\/linenumber\nvar sw = 0.5;\/\/strokeweight\n\n\nfunction setup(){\n    createCanvas(300,400);\n}\n\nfunction draw(){\n    background(0);\n\n    strokeWeight(1);\n\n    \/\/reference red\n    stroke(183,58,66);\n    line(10,10,50,250);\n    line(250,10,250,350);\n    line(50,250,250,350);\n\n    dx1 = (50-10)\/numl;\n    dy1 = (250-10)\/numl;\n    dx2 = (250-250)\/numl;\n    dy2 = (350-10)\/numl;\n    dx3 = (250-50)\/numl;\n    dy3 = (350-250)\/numl;\n\n    \/\/defineshape\n    var x1 = 10;\n    var y1 = 10;\n    var x2 = 250;\n    var y2 = 10;\n    var x3 = 50;\n    var y3 = 350;\n\n\n    \/\/drawlines\n    for (var c = 0; c &lt;= numl; c = c + 1){\n        stroke(255,0,0);\n        strokeWeight(sw);\n        \/\/squarelinepath\n        line(x1,y1,x2,y2);\n        \/\/trianglelinepath\n        line(x2,y1,x1,x2);\n        \/\/curvepath\n        line(x3,y1,x2,y2);\n        \/\/rect\n        line(x1,y1,x2,y1);\n\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n        x3 += dx3;\n        y3 += dy3;\n\n    \/\/interaction:changeslineform\n    if (mouseIsPressed){\n        x1 += 1;\n        y1 += 1;\n        x2 += 3;\n        y2 += 2;\n        x3 += 3;\n        y3 += 3;\n\n    }\n\n\n    }\n\n        }\n\n\n    \n\n\n<\/code><\/pre><\/p>\n\n\n\n<p>I enjoyed coding this project because by changing a few variables, I get to create different interesting compositions. Compared to the previous projects, I feel like this one is more intuitive than planned. During the process, I faced difficulty understanding what each variable does. However, after looking at some examples and experimenting, I understood my variables better and was able to alter them to achieve the effects I wanted. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>luca string var dx1; var dy1; var dx2; var dy2; var dx3; var dy3; var numl = 40;\/\/linenumber var sw = 0.5;\/\/strokeweight function setup(){ createCanvas(300,400); } function draw(){ background(0); strokeWeight(1); \/\/reference red stroke(183,58,66); line(10,10,50,250); line(250,10,250,350); line(50,250,250,350); dx1 = (50-10)\/numl; dy1 = (250-10)\/numl; dx2 = (250-250)\/numl; dy2 = (350-10)\/numl; dx3 = (250-50)\/numl; dy3 = (350-250)\/numl; \/\/defineshape &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/26\/project-4-string-art-8\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 4: String Art&#8221;<\/span><\/a><\/p>\n","protected":false},"author":642,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,58,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66604"}],"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\/642"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66604"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66604\/revisions"}],"predecessor-version":[{"id":67028,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66604\/revisions\/67028"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}