{"id":66889,"date":"2021-10-03T23:16:41","date_gmt":"2021-10-04T03:16:41","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66889"},"modified":"2021-10-03T23:16:41","modified_gmt":"2021-10-04T03:16:41","slug":"project-05-wallpaper-12","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/03\/project-05-wallpaper-12\/","title":{"rendered":"Project 05: 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=\"600\" data-height=\"600\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-32.js\">sketch<\/a><a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-32.js\" class=\"wp-block-file__button\" download><\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"600\" height=\"600\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Catherine Liu\n\/\/jianingl\n\/\/Section D\n\nvar catList = [1, 2, 3]; \/\/keeps track of cat for genration of wallpaper\n\nfunction setup() {\n    createCanvas(600, 600);\n    background(230,230,250);\n}\n\nfunction draw() {\n    for (var y = 30; y &lt;= 600; y += 100) {\n        for (var x = 50; x &lt;= 550; x += 150) {\n            var cat = random(catList); \/\/randomly generates a cat at that position\n            if (cat == 1) {\n                CatStand(x,y);\n            } else if (cat == 2) {\n                CatFront(x,y);\n            } else if (cat == 3) {\n                CatSit(x,y);\n            }\n        }\n    }\n    noLoop()\n}\n\nfunction CatStand (x, y) {\n    strokeWeight(2);\n    push();\n    noFill();\n    strokeWeight(5);\n    stroke(233,150,122);\n    arc(x + 60, y-20, 50, 50, 0, HALF_PI); \/\/tail\n    pop();\n\n    stroke(139,69,19)\n    fill(233,150,122);\n    ellipse(x+60, y + 40, 5, 20); \/\/ back left leg\n    ellipse(x+10, y + 40, 5, 20); \/\/ left front leg\n    ellipse(x + 40, y + 20, 80, 50); \/\/body\n    triangle(x + 15, y - 15, x + 30, y - 25, x + 25, y - 5); \/\/ right ear\n    triangle(x - 15, y - 15, x - 30, y - 25, x - 25, y - 5); \/\/ left ear\n    ellipse(x, y, 50, 40); \/\/head\n    ellipse(x+70, y + 42, 5, 20); \/\/back right leg\n    ellipse(x+18, y + 43, 5, 20); \/\/ right front leg\n\n    fill(100,107,47);\n    ellipse(x-15, y, 10, 5); \/\/left eye\n    ellipse(x+5, y, 10, 5); \/\/right eye\n    fill(205,92,92);\n    ellipse(x-7, y+5, 5, 3); \/\/nose\n\n    stroke(0,100,0);\n    fill(50,205,50);\n    circle(x-20, y+50, 10);\n    push();\n    noFill();\n    arc(x -65, y+45, 50, 50, 0, HALF_PI);\n    pop();\n    circle(x-35, y +50, 15);\n    push();\n    noFill();\n    arc(x + 83, y-20, 50, 50, 0, HALF_PI);\n    pop();\n    circle(x+ 85, y+3, 8);\n\n}\n\nfunction CatFront (x, y) {\n    strokeWeight(2);\n    push();\n    noFill();\n    strokeWeight(5);\n    stroke(139,69,19);\n    arc(x + 45, y-20, 50, 50, 0, HALF_PI); \/\/tail\n    pop();\n\n    stroke(139,69,19)\n    fill(255,218,185);\n    ellipse(x+10, y+10, 90, 70); \/\/body\n    triangle(x + 15, y - 15, x + 30, y - 25, x + 25, y - 5); \/\/ right ear\n    triangle(x - 15, y - 15, x - 30, y - 25, x - 25, y - 5); \/\/ left ear\n    ellipse(x, y, 50, 40); \/\/head\n    fill(119,136,153);\n    ellipse(x-15, y, 10, 5); \/\/left eye\n    ellipse(x+5, y, 10, 5); \/\/right eye\n    fill(244,164,96);\n    ellipse(x-7, y+5, 5, 3); \/\/nose\n\n\n    fill(255,218,185);\n    ellipse(x + 35, y + 40, 20, 10); \/\/ right leg\n    ellipse(x - 10, y + 40, 20, 10); \/\/ left leg\n\n    stroke(70,130,180);\n    push();\n    noFill();\n    arc(x -60, y+45, 50, 50, 0, HALF_PI);\n    arc(x + 80, y+15, 50, 50, 0, HALF_PI)\n    pop();\n    fill(135,206,235);\n    circle(x-30, y+45, 10);\n    circle(x+80, y+45, 15);\n}\n\nfunction CatSit (x, y) {\n    strokeWeight(2);\n    push();\n    noFill();\n    strokeWeight(5);\n    stroke(119,136,153);\n    arc(x + 60, y-10, 50, 50, 0, HALF_PI); \/\/tail\n    pop();\n\n    stroke(139,69,19);\n    fill(119,136,153);\n    ellipse(x+5, y+50, 10, 20); \/\/front right leg\n    ellipse(x+30, y+30, 70, 60); \/\/body\n    ellipse(x+45, y+50, 30, 20); \/\/back leg\n    ellipse(x+15, y+50, 10, 20); \/\/front left leg\n    triangle(x + 15, y - 15, x + 30, y - 25, x + 25, y - 5); \/\/ right ear\n    triangle(x - 15, y - 15, x - 30, y - 25, x - 25, y - 5); \/\/ left ear\n    ellipse(x, y, 50, 40); \/\/head\n    fill(0,100,0)\n    ellipse(x, y, 10, 5); \/\/left eye\n    ellipse(x-15, y, 10, 5); \/\/right eye\n    fill(40,26,13)\n    ellipse(x-7, y+5, 5, 3); \/\/nose\n\n    stroke(75,0,130);\n    fill(147,112,219);\n    circle(x+60, y-15, 15);\n    circle(x+75, y-15, 15);\n    ellipse(x+75, y-5, 10, 5);\n    ellipse(x+60, y-5, 10, 5);\n\n    push();\n    strokeWeight(3)\n    line(x+67, y-15,x+67, y-5);\n    pop();\n\n    push();\n    noFill();\n    arc(x -65, y+45, 50, 50, 0, HALF_PI);\n    pop();\n    circle(x-35, y +50, 15);\n}\n\n<\/code><\/pre><\/p>\n\n\n\n<p>Before creating this wallpaper, one of my friends from home called me and showed me pictures of her cats. In the spur of the moment, I thought that it&rsquo;d be cute to create a wallpaper full of cats. I also thought it would be cool if the wallpaper could generate different versions of itself. For this, I created 3 different cats and had the draw function choose a random cat to draw each time it ran through the 2 for loops. For each cat, I drew up a quick sketch of what I wanted each cat to look like and added some decorative yarn and butterflies to make them look more like wallpaper:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"768\" height=\"1024\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-28-768x1024.jpg\" alt=\"\" class=\"wp-image-67094\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-28-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-28-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-28-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-28-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-28-1200x1600.jpg 1200w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-28.jpg 1620w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\"><figcaption>quick sketches of different cat positions<\/figcaption><\/figure><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch \/\/Catherine Liu \/\/jianingl \/\/Section D var catList = [1, 2, 3]; \/\/keeps track of cat for genration of wallpaper function setup() { createCanvas(600, 600); background(230,230,250); } function draw() { for (var y = 30; y &lt;= 600; y += 100) { for (var x = 50; x &lt;= 550; x += 150) { var &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/03\/project-05-wallpaper-12\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 05: Wallpaper&#8221;<\/span><\/a><\/p>\n","protected":false},"author":654,"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\/f2021\/wp-json\/wp\/v2\/posts\/66889"}],"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\/654"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66889"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66889\/revisions"}],"predecessor-version":[{"id":67095,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66889\/revisions\/67095"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}