{"id":73500,"date":"2022-10-01T18:40:49","date_gmt":"2022-10-01T22:40:49","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73500"},"modified":"2022-10-01T18:40:49","modified_gmt":"2022-10-01T22:40:49","slug":"project-05-wallpaper-4","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/01\/project-05-wallpaper-4\/","title":{"rendered":"Project 05 \u2013\u00a0Wallpaper"},"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>Stereoscopic style wallpaper with randomly generated shapes throughout composition. <\/p>\n\n\n\n<div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/sketch-22.js\" data-width=\"400\" data-height=\"600\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"400\" height=\"600\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Aarnav Patel\n\/\/Section D\n\/\/aarnavp@andrew.cmu.edu\n\/\/Project-05\n\nvar side = 100;\nvar radius = 0.8 * side\nfunction setup() {\n    createCanvas(600, 600);\n    background(0);\n}\n\nfunction draw() {\n\tnoStroke();\n\n\tlet arr1 = [1, 2, 3];\n\tcount = 0;\n\tfor (var y = 0; y &lt; height; y += side) {\n\t\tcount = count + 1; \n\t\tfor (var x = 0; x &lt; width; x += side) {\n\t\t\tif (count == floor(random(0, 5))) {\n\t\t\t\tdrawTile(x, y);\n\t\t\t\tdrawRandomShape(x, y);\n\t\t\t\tcount = 0;\n\t\t\t} else {\n\t\t\t\tdrawTile(x, y);\n\t\t\t}\n\t\t}\n\t}\n\tnoLoop();\n}\n\nfunction drawTile(x, y) {\n\tfill(0, 0, 255, 150);\n\tellipse(x + side \/ 2, y + side \/ 2, radius);\n\tfill(255, 0, 0, 100);\n\tellipse(x + radius \/ 2, (y + side \/ 2 ), radius);\n\n\tfill(0, 0, 255, 100);\n\ttriangle(x - 5, y - 5, (x + side) - 5, y - 5, x - 5, (y + side) - 5);\n\tfill(255, 0, 0, 150);\n\ttriangle(x, y, x + side, y, x, y + side);\n\n}\n\nfunction drawRandomShape(x, y) {\n\tvar r = floor(random(0, 3));\n\tfill(255);\n\n\tif (r == 0) {\n\t\trectMode(CENTER);\n\t\trect(x + (side \/ 2), y + (side \/ 2), side * 0.1, side * 0.5);\n\t\trect(x + (side \/ 2), y + (side \/ 2), side * 0.5, side * 0.1);\n\t} else if (r == 1) {\n\t\trectMode(CENTER);\n\t\trect(x + (side \/ 2), y + (side \/ 2), side * 0.1, side * 0.5);\n\t} else {\n\t\trectMode(CENTER);\n\t\trect(x + (side \/ 2), y + (side \/ 2), side * 0.5, side * 0.1);\n\t}\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Stereoscopic style wallpaper with randomly generated shapes throughout composition. sketch \/\/Aarnav Patel \/\/Section D \/\/aarnavp@andrew.cmu.edu \/\/Project-05 var side = 100; var radius = 0.8 * side function setup() { createCanvas(600, 600); background(0); } function draw() { noStroke(); let arr1 = [1, 2, 3]; count = 0; for (var y = 0; y &lt; height; y &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/01\/project-05-wallpaper-4\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 05 \u2013\u00a0Wallpaper&#8221;<\/span><\/a><\/p>\n","protected":false},"author":750,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[104,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73500"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/750"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73500"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73500\/revisions"}],"predecessor-version":[{"id":73503,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73500\/revisions\/73503"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}