{"id":66969,"date":"2021-10-03T01:14:28","date_gmt":"2021-10-03T05:14:28","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66969"},"modified":"2021-10-03T01:14:28","modified_gmt":"2021-10-03T05:14:28","slug":"project-05-wallpaper-8","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/03\/project-05-wallpaper-8\/","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>I applied the same coding structure I used in my assignment A to this project. Then, I changed the repeated shapes from Hexagon to my designed shapes 1 and 2. Because of the assignment A, it is relatively easy to create this wallpaper pattern.<\/p>\n\n\n<div class=\"wp-block-file\"><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-20.js\" data-width=\"400\" data-height=\"300\">project05: wallpaper<\/a><a class=\"wp-block-file__button\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-20.js\" download=\"\">Download<\/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\">var x;\nvar y;\nvar a=20;\nvar b=20;\n\n\n\nfunction setup() {\n    createCanvas(400, 300);\n    background( 240,230,140);\n}\n\n\/\/shape in the first column\nfunction shape1(){\n    push();\n    translate(a,b);\n    noStroke();\n    x=0;\n    y=0;\n    var s = 10;\n    if(color==1){\n        fill(255);\n        circle(x,y,s);\n        fill(175,238,238);\n        circle(x,y+5,s);\n        color+=1;\n    }\n    else{\n        fill(175,238,238);\n        circle(x,y,s);\n        fill(255);\n        circle(x,y+5,s);\n        color=1;\n    }\n    \n    pop();\n}\n\/\/shape in the second column\nfunction shape2(){\n    push();\n    translate(a,b);\n\n    x=0;\n    y=0;\n    var d=5;\n    strokeWeight(2);\n    stroke(139,69,19);\n    line(x-d,y,x,y-10);\n    line(x+d,y,x,y-10);\n    noStroke();\n    fill(255,69,0);\n    circle(x-d,y,10);\n    circle(x+d,y,10);\n    pop();\n}\n\nfunction draw() {\n    \/\/two circles\n    for(b=20; b&lt;=400; b +=50){\n        for(a=20; a&lt;=500; a+=50){\n            shape1();\n        }\n    }\n\n    \/\/cherry shape\n    \n    for(b=50; b&lt;=250; b +=50){\n        for(a=45; a&lt;=350; a+=50){\n            shape2();\n        }\n    }\n\n\n}<\/code><\/pre><\/div>\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I applied the same coding structure I used in my assignment A to this project. Then, I changed the repeated shapes from Hexagon to my designed shapes 1 and 2. Because of the assignment A, it is relatively easy to create this wallpaper pattern. project05: wallpaperDownload var x; var y; var a=20; var b=20; function &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/03\/project-05-wallpaper-8\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project-05: Wallpaper&#8221;<\/span><\/a><\/p>\n","protected":false},"author":676,"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\/66969"}],"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\/676"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66969"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66969\/revisions"}],"predecessor-version":[{"id":66972,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66969\/revisions\/66972"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}