{"id":66652,"date":"2021-09-27T00:16:52","date_gmt":"2021-09-27T04:16:52","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66652"},"modified":"2021-09-27T11:06:39","modified_gmt":"2021-09-27T15:06:39","slug":"project-4-string-art-9","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/27\/project-4-string-art-9\/","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><a class=\"p5_sketch_link\" data-width=\"400\" data-height=\"300\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-198.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=\"400\" height=\"300\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Elise Chapman\n\/\/ejchapma\n\/\/Section D\n\nfunction setup() {\n    createCanvas(400,300);\n}\n\nvar dx1;\nvar dy1;\nvar dx2;\nvar dy2;\n\nfunction draw() {\n    background(30,50,49); \/\/periwinkle\n    var dist=100; \/\/distance from center of spiral\n    var angle=5;\n    var y=100;\n    var x=100;\n    push();\n    \/\/intricate purple\n    translate(width\/2+25,height\/2+25); \/\/sets center of spiral\n    for(y=100; y&lt;=200; y+=0.5) {\n        strokeWeight(2);\n        stroke(153,141,160); \/\/purple\n        rotate(radians(angle*10));\n        line(mouseX\/15,mouseY\/15,mouseX+dist,y);\n        dist-=0.5;\n    }\n    \/\/star\n    for (y=10;y&lt;=300;y+=5) {\n        strokeWeight(5);\n        stroke(196,231,212); \/\/grey\n        rotate(radians(-angle+180)); \/\/creates the spiral\n        line(x+dist, y+dist, min(mouseX\/2,300), min(mouseY\/2,50));\n        dist-=1;\n    }\n    \/\/straight line spread\n    pop();\n    var numLines=20;\n    dx1=0\/numLines;\n    dy1=mouseY\/numLines;\n    dx2=mouseX\/numLines;\n    dy2=0\/numLines;\n    var x1=0;\n    var y1=100;\n    var x2=500;\n    var y2=250;\n    for (var i=0; i&lt;=numLines; i+=1) {\n        stroke(300);\n        strokeWeight(3);\n        line(x1,y1,x2,y2);\n        x1+=dx1;\n        y1+=dy1;\n        x2+=dy2;\n        y2+=dy2;\n    }\n}\n<\/code><\/pre><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>I wasn&rsquo;t too sure about my string art going into programming. I didn&rsquo;t really have a clear vision and in the end I kept playing around with the code until I reached a point I like. In the future, I think I&rsquo;m going to try to redo this code on my own &ndash; I think it would be an engaging entrance piece for my website. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I wasn&rsquo;t too sure about my string art going into programming. I didn&rsquo;t really have a clear vision and in the end I kept playing around with the code until I reached a point I like. In the future, I think I&rsquo;m going to try to redo this code on my own &ndash; I think &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/27\/project-4-string-art-9\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 4: String Art&#8221;<\/span><\/a><\/p>\n","protected":false},"author":644,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66652"}],"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\/644"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66652"}],"version-history":[{"count":9,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66652\/revisions"}],"predecessor-version":[{"id":66691,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66652\/revisions\/66691"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}