{"id":73741,"date":"2022-10-03T00:02:42","date_gmt":"2022-10-03T04:02:42","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73741"},"modified":"2022-10-03T00:03:24","modified_gmt":"2022-10-03T04:03:24","slug":"project-05-wallpaper-12","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/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>cybergoth dragon recursion!!!<\/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-49.js\" data-width=\"400\" data-height=\"600\">sketch<\/a>\n\n\n\n<p><\/p><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\">\/\/ Zoe Lin (ID: youlin)\n\/\/ Section B\n\nfunction setup() {\n  createCanvas(400, 600);\n  noLoop();\n  strokeWeight(0.025);\n}\n\nfunction draw() {\n  callDragon(5, 5, width\/1.5, height\/2.5, 40);\n\nfunction callDragon(x, y, width, height, d){\n    background(255);\n    d = map(40, 0, 60, 10, 16);\n\n    push(); \/\/dragon1\n    drawDragon(x + width\/3, y-2, width, height, d);\n    pop();\n\n    push(); \/\/dragon2\n    drawDragon(x + width\/3, y+height+2, width, height, d);\n    pop();\n  \n    push(); \/\/dragon3\n    drawDragon(x + width\/3, y+height*2+2, width, height, d);\n    pop();\n  \n    \/\/push(); \/\/dragon4\n    \/\/drawDragon(x + width\/4.5, y+height*2.5, width, height, d);\n    \/\/pop();\n}\n\nfunction drawDragon(x, y, width, height, d){\n    \n    \/\/draw\n    triangle(x , y+height\/2.5, x+width\/2, y, x+width, y+height\/2);\n    translate(x, y+height\/2);\n  \n    push();\n    dragon(width, d);\n    pop();\n}\n\nfunction dragon(len, d) {\n    if (d &lt;= 0) {\n        return;\n    }\n\n    fill(255);\n    triangle(0, 0, len\/2, -(len\/2), len\/2.5, 0);\n    push();\n\n    var newLen = len\/1.4;\n    rotate(- PI\/4);\n    fill(0);\n    triangle(0, 0, newLen, 0, newLen\/2.5, -(newLen\/2));\n    dragon(newLen, d - 1); \/\/recursion\n    pop();\n\n    push();\n    translate(len, 1.4);\n    rotate(-3 * PI\/4);\n    fill(0);\n    triangle(0, 0, newLen, 0, newLen\/2.5, -(newLen\/3));\n    dragon(newLen, d - 1);\n    pop();  \n}\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>cybergoth dragon recursion!!! sketch \/\/ Zoe Lin (ID: youlin) \/\/ Section B function setup() { createCanvas(400, 600); noLoop(); strokeWeight(0.025); } function draw() { callDragon(5, 5, width\/1.5, height\/2.5, 40); function callDragon(x, y, width, height, d){ background(255); d = map(40, 0, 60, 10, 16); push(); \/\/dragon1 drawDragon(x + width\/3, y-2, width, height, d); pop(); push(); \/\/dragon2 drawDragon(x &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/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":740,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[104,56,1],"tags":[81],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73741"}],"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\/740"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73741"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73741\/revisions"}],"predecessor-version":[{"id":73745,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73741\/revisions\/73745"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}