{"id":66779,"date":"2021-10-01T11:06:39","date_gmt":"2021-10-01T15:06:39","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66779"},"modified":"2021-10-01T11:06:39","modified_gmt":"2021-10-01T15:06:39","slug":"project-5-wallpaper","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/01\/project-5-wallpaper\/","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><div class=\"wp-block-file\"><a class=\"p5_sketch_link\" data-height=\"600\" data-width=\"400\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-1.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=\"600\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Anthony Pan\n\/\/Section C\n\n\nfunction setup() {\n    createCanvas(400, 600);\n}\n\nfunction draw() {\n    var dx = 0; \n    var dy = 0;\n    var dx1 = 0;\n    var dy1 = 0;\n    background(232, 249, 255); \/\/sky blue background\n    branches(dx, dy); \/\/call branches function inputing dx and dy to create pattern\n    cherryBlossom(dx1, dy1); \/\/call cherryBlossom function to create 6 flowers on each branch\n\n\n    noLoop();\n}\n\n\nfunction branches(dx, dy) {\n    strokeWeight(3);\n    stroke(0);\n\n    for(var column = 0; column &lt; 10; column += 1) {\n        \n        for(var row = 0; row &lt; 9; row +=1) {\n            line(50 + dx, 55 + dy, 55 + dx, 85 + dy); \/\/bottom of main branch\n            line(35 + dx, 40 + dy, 50 + dx, 55 + dy); \/\/middle of main branch\n            line(10 + dx, 20 + dy, 35 + dx, 40 + dy); \/\/top of main branch\n            line(15 + dx, 35 + dy, 35 + dx, 40 + dy); \/\/small branch below top main branch\n            line(15 + dx, 5 + dy, 25 + dx, 32 + dy); \/\/small branch above top main branch\n            line(55 + dx, 20 + dy, 45 + dx, 50 + dy); \/\/small branch right of middle main branch\n            line(60 + dx, 35 + dy, 50 + dx, 40 + dy); \/\/smallest branch right of middle main\n            dy += 65; \n        }\n        dx += 80;\n        dy = 0;\n    }\n    \n}\n\nfunction cherryBlossom(dx1, dy1) {\n    strokeWeight(1);\n    var color = random(120, 230); \/\/random shade of pink - yellow \n    var color1 = random(120, 230); \/\/random shade of pink - yellow\n    var color2 = random(120, 230); \/\/random shade of pink - yellow\n    var r = 8; \/\/radius of outer petals \n    var r1 = 4; \/\/radius of center petal\n\n    for(var c = 0; c &lt; 10; c += 1) {\n        for(var row1 = 0; row1 &lt; 9; row1 += 1) {\n            fill(252, color, 174); \/\/pink fill for flowers random shades of pink\n            ellipse(15 + dx1, (10 - r1) + dy1, r, r); \/\/top petal\n            ellipse((15 + r1) + dx1, 10 + dy1, r , r); \/\/right petal\n            ellipse(15 + dx1, (10 + r1) + dy1 , r, r); \/\/bottom petal\n            ellipse((15 - r1) + dx1, 10 + dy1, r, r); \/\/left petal\n\n            fill(252, 174, 174);\n            ellipse(15 + dx1, 10 + dy1, r1, r1); \/\/center petal\n\n            fill(252, color1, 174);\n            ellipse(25 + dx1, (25 - r1) + dy1, r, r);\n            ellipse((25 + r1) + dx1, 25 + dy1, r, r);\n            ellipse(25 + dx1, (25 + r1) + dy1, r, r);\n            ellipse((25 - r1) + dx1, 25 + dy1, r, r);\n\n            fill(252, 174, 174);\n            ellipse(25 + dx1, 25 + dy1, r1, r1); \/\/center petal\n\n            fill(252, color2, 174);\n            ellipse(11 + dx1, (35 - r1) + dy1, r, r);\n            ellipse((11 + r1) + dx1, 35 + dy1, r, r);\n            ellipse(11 + dx1, (35 + r1) + dy1, r, r);\n            ellipse((11 - r1) + dx1, 35 + dy1, r, r);\n\n            fill(252, 174, 174);\n            ellipse(11 + dx1, 35 + dy1, r1, r1); \/\/center petal\n\n            fill(252, color, 174);\n            ellipse(40 + dx1, (40 - r1) + dy1, r, r);\n            ellipse((40 + r1) + dx1, 40 + dy1, r, r);\n            ellipse(40 + dx1, (40 + r1) + dy1, r, r);\n            ellipse((40 - r1) + dx1, 40 + dy1, r, r);\n\n            fill(252, 174, 174);\n            ellipse(40 + dx1, 40 + dy1, r1, r1); \/\/center petal\n\n            fill(252, color1, 174);\n            ellipse(55 + dx1, (20 - r1) + dy1, r, r);\n            ellipse((55 + r1) + dx1, 20 + dy1, r, r);\n            ellipse(55 + dx1, (20 + r1) + dy1, r, r);\n            ellipse((55 - r1) + dx1, 20 + dy1, r, r);\n\n            fill(252, 174, 174);\n            ellipse(55 + dx1, 20 + dy1, r1, r1); \/\/center petal\n\n            fill(252, color2, 174);\n            ellipse(60 + dx1, (35 - r1) + dy1, r, r);\n            ellipse((60 + r1) + dx1, 35 + dy1, r, r);\n            ellipse(60 + dx1, (35 + r1) + dy1, r, r);\n            ellipse((60 - r1) + dx1, 35 + dy1, r, r);\n\n            fill(252, 174, 174);\n            ellipse(60 + dx1, 35 + dy1, r1, r1); \/\/center petal\n\n            dy1 += 65;\n\n        }\n        dx1 += 80;\n        dy1 = 0; \/\/reset dy1 when it hits bottom of column \n    }\n\n    \n\n\n\n\n\n\n\n\n\n\n\n    \n\n\n\n}\n<\/code><\/pre><\/div>\n\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch \/\/Anthony Pan \/\/Section C function setup() { createCanvas(400, 600); } function draw() { var dx = 0; var dy = 0; var dx1 = 0; var dy1 = 0; background(232, 249, 255); \/\/sky blue background branches(dx, dy); \/\/call branches function inputing dx and dy to create pattern cherryBlossom(dx1, dy1); \/\/call cherryBlossom function to create &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/01\/project-5-wallpaper\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 5: Wallpaper&#8221;<\/span><\/a><\/p>\n","protected":false},"author":635,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[104,57],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66779"}],"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\/635"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66779"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66779\/revisions"}],"predecessor-version":[{"id":66783,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66779\/revisions\/66783"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}