{"id":66564,"date":"2021-09-26T18:23:00","date_gmt":"2021-09-26T22:23:00","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66564"},"modified":"2021-09-26T18:23:00","modified_gmt":"2021-09-26T22:23:00","slug":"project-4-string-art-7","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/26\/project-4-string-art-7\/","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><div class=\"wp-block-file\"><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-186.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\">\/\/Eva Oney\n\/\/eoney\n\/\/section C\n\nvar c1 = 0;\nvar c2 = 255;\n\nfunction setup() {\n    createCanvas(400, 300);\n    background(220);\n    text(\"p5.js vers 0.9.0 test.\", 10, 15);\n\n}\n\nfunction draw() {\n    background(0);\n    \/\/loop for lines coming off the x axis\n    for (var i = 1; i &lt;= 500; i += 5) {\n        stroke(255,0,0);\n\/\/I found my x and y values by originally setting x1 and x2 to mouseX\n\/\/and mouseY, then when I found a position I liked, I printed the value\n\/\/of mouseX and mouseY and got (15,400)\n        line(400 + i, 0, 15 +i, 150);\n        line(15 + i, 150, 400 +i, 400);\n    }\n    \/\/loop for lines coming off the y axis\n    for(var i = 0; i &lt;=500; i +=5) {\n        stroke(0,0,255);\n        line(0, 400 + i, 200, 15 + i );\n        line(400, 400 + i, 200, 15 +i);\n    }\n    noLoop();\n }\n\n<\/code><\/pre><\/div>\n\n\n\n<p>I kept my code pretty simple so I could focus on understanding how the loops and parameters actually affect the image. I am not a math wiz by nature, so it is a little difficult for me to understand but I am slowly getting the hang of it. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I kept my code pretty simple so I could focus on understanding how the loops and parameters actually affect the image. I am not a math wiz by nature, so it is a little difficult for me to understand but I am slowly getting the hang of it.<\/p>\n","protected":false},"author":665,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,57,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66564"}],"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\/665"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66564"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66564\/revisions"}],"predecessor-version":[{"id":66567,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66564\/revisions\/66567"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}