{"id":66802,"date":"2021-10-01T15:38:20","date_gmt":"2021-10-01T19:38:20","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66802"},"modified":"2021-10-01T15:38:20","modified_gmt":"2021-10-01T19:38:20","slug":"project-05","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/01\/project-05\/","title":{"rendered":"Project-05"},"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 started with some shapes and it turned into something pretty cool.<\/p>\n\n\n\n<div><a class=\"p5_sketch_link\" data-height=\"600\" data-width=\"600\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Project-05.js\">Project-05<\/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\">\/\/Luke Mattson\n\/\/section A\n\n\n\n\n\nfunction setup(){\n\tcreateCanvas(600, 600);\n    background(224, 201, 166)\n}\n\n\nfunction draw() {\n    \/\/drawing the hexagons\n   for (x = 40; x &lt; 600; x += 87) {\n        for (y = 55; y &lt; 600; y+=160) {\n            hexagon(x,y,30)\n            hexagon(x,y,40)\n        }\n    }\n    for (x = -5; x &lt; 700; x += 87) {\n        for (y = -25; y &lt; 700; y+=160) {\n            hexagon(x,y,30)\n            hexagon(x,y,40)\n        }\n    }\n\n    \/\/drawing the triangles in between the hexagons\n    for (x = -3.5; x &lt; 700; x += 87) {\n        for (y = 53; y &lt; 700; y+=160) {\n            trianglePair(x,y)\n        }\n    }\n    for (x = 39; x &lt; 700; x += 87) {\n        for (y = -27; y &lt; 700; y+=160) {\n            trianglePair(x,y)\n        }\n    }\n\n    \/\/drawing pumkins inside the hexagons\n    for (x = 41; x &lt; 700; x += 87) {\n        for (y = 57; y &lt; 700; y+=160) {\n            pumpkin(x,y)\n        }\n    }\n    for (x = -5; x &lt; 700; x += 87) {\n        for (y = 137; y &lt; 700; y+=160) {\n            pumpkin(x,y)\n        }\n    }\n    noLoop()\n}\n\nfunction hexagon(x,y,s) {\n    stroke(210,83,73)\n    strokeWeight(.5)\n    noFill()\n    beginShape()\n    vertex(x+s,y)\n    vertex(x+s\/2,y+s*sqrt(3)\/2)\n    vertex(x-s\/2,y+s*sqrt(3)\/2)\n    vertex(x-s,y)\n    vertex(x-s\/2,y-s*sqrt(3)\/2)\n    vertex(x+s\/2,y-s*sqrt(3)\/2)\n    endShape(CLOSE)\n}\n\nfunction trianglePair(x,y) {\n    fill(210,83,73)\n    triangle(x,y,x-23,y-40,x+23,y-40)\n    triangle(x,y+4,x-23,y+44,x+23,y+44)\n}\n\nfunction pumpkin(x,y) {\n  pHeight = 30\n  pWidth = 40 \n\n  \/\/stem\n  strokeWeight(2)\n  stroke(0, 150, 0);\n  line(x, y-pHeight\/2, x-pWidth\/4, y - pHeight*.75);\n \n  \/\/pumpkin\n  strokeWeight(1);\n  fill(230, 100, 0);\n  stroke(120, 60, 0);\n  ellipse(x,y, pWidth, pHeight);\n  ellipse(x,y, pWidth*.75, pHeight);\n  ellipse(x,y, pWidth*.5, pHeight);\n  ellipse(x,y, pWidth*.25, pHeight);\n}<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I started with some shapes and it turned into something pretty cool.<\/p>\n","protected":false},"author":659,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[104,55],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66802"}],"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\/659"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66802"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66802\/revisions"}],"predecessor-version":[{"id":66804,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66802\/revisions\/66804"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}