{"id":67049,"date":"2021-10-03T21:40:29","date_gmt":"2021-10-04T01:40:29","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=67049"},"modified":"2021-10-03T21:42:49","modified_gmt":"2021-10-04T01:42:49","slug":"project-5-wallpaper-15","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/03\/project-5-wallpaper-15\/","title":{"rendered":"Project 5: Wallpaper"},"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=\"590\" data-height=\"390\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-27.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=\"590\" height=\"390\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ John Henley; jhenley; 15-104 section D\n\nfunction setup() {\n    createCanvas(590, 395);\n    background(0);\n}\n\nfunction draw() {\n    for (var x = 10; x &lt;= 590; x+= 30) { \/\/ vertical lines\n        linesVertical(x);\n    }\n    for (var y = 10; y &lt;= 390; y += 30) { \/\/ horizontal lines\n        linesHorizontal(y);\n    }\n    for (var y = 10; y &lt;= 390; y += 15) { \/\/ circles columns\n        for (var x = 10; x &lt;= 590; x+= 15) { \/\/ circles rows\n            circles(x, y);\n        }\n    }\nnoLoop();\n}   \n\nfunction circles(x, y) { \/\/circle function\n    stroke(0);\n    fill(random(0, 255));\n    circle(x,y,random(5, 15));\n}\n\nfunction linesVertical(x) { \/\/vertical lines function (random lengths)\n    stroke(255);\n    line(x, random(0, 390), x, random(0,390));\n}\n\nfunction linesHorizontal(y) { \/\/horizontal lines function (random lengths)\n    line (random(0, 590), y, random(0,590), y)\n}<\/code><\/pre><\/p>\n\n\n\n<p>For my wallpaper, I wanted to make a row of lit up circles, almost like an old-fashioned light-up sign. Each of the circles is like a bulb, and despite the pattern with the &ldquo;for&rdquo; loops, I made it so the diameter of the circles was chosen randomly to make the image&rsquo;s picture seemingly change with each refresh. To add visual interest, I added perpendicular lines, chosen with random lengths, cutting through the circles.<\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch \/\/ John Henley; jhenley; 15-104 section D function setup() { createCanvas(590, 395); background(0); } function draw() { for (var x = 10; x &lt;= 590; x+= 30) { \/\/ vertical lines linesVertical(x); } for (var y = 10; y &lt;= 390; y += 30) { \/\/ horizontal lines linesHorizontal(y); } for (var y = &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/03\/project-5-wallpaper-15\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 5: Wallpaper&#8221;<\/span><\/a><\/p>\n","protected":false},"author":650,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[104],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67049"}],"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\/650"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=67049"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67049\/revisions"}],"predecessor-version":[{"id":67054,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67049\/revisions\/67054"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=67049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=67049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=67049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}