{"id":74180,"date":"2022-10-09T21:57:05","date_gmt":"2022-10-10T01:57:05","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=74180"},"modified":"2022-10-09T21:57:59","modified_gmt":"2022-10-10T01:57:59","slug":"project-06-abstract-clock-14","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/09\/project-06-abstract-clock-14\/","title":{"rendered":"Project 06- Abstract Clock"},"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><em>Graham Murtha<\/em><\/p>\n\n\n\n<p><em>Section A<\/em><\/p>\n\n\n\n<p>For this project, I wanted to document time with an apple tree\/ deciduous tree.  As the minute passes, the leaves change color from green to red, and at the end of each minute wilt off and blow away.  As the hour passes, the ground that the tree is on grows more and more red as the leaves\/apples fall to the ground.  As the day passes, the background color (sky) gets darker and darker, until the last hour of the day, where it goes totally black.  There is also a person under the tree trying to collect the falling foliage\/apples.  <\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"865\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/IMG_0513-1024x865.jpg\" alt=\"\" class=\"wp-image-74183\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/IMG_0513-1024x865.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/IMG_0513-300x253.jpg 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/IMG_0513-768x649.jpg 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/IMG_0513-1536x1298.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/IMG_0513-2048x1730.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/IMG_0513-1200x1014.jpg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/sketch-96.js\" data-width=\"400\" data-height=\"600\">sketch<\/a><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\">\/\/ Graham Murtha\n\/\/Section A\n\/\/gmurtha@andrew.cmu.edu\n\/\/Project 06 Abstract Clock\n\n\n\/\/ IF YOU STICK AROUND FOR A BIT THE LEAVES WILL WILT AND BLOW AWAY!!\n\nvar y = 0\nfunction setup() {\n    createCanvas(420, 480);\n    background(200,200,255);\n    text(\"p5.js vers 0.9.0 test.\", 10, 15);\n    angleMode(DEGREES);\n}\n\nfunction draw() {\n\n    \/\/background color of sky\/\/ CHANGES THROUGHOUT THE DAY- DARKEST AT THE 24TH HOUR\n    var h = hour()\n    var sky = map(h,0,24,255,0)\n    background(50,100,sky);\n\n    \/\/ outline\n    stroke(200)\n    noFill();\n    strokeWeight(.5);\n    ellipse(width\/2,height\/2.75, 300);\n\n    \/\/ Tree trunk\n    noStroke();\n    fill(100,60,0)\n    rect((width\/2)-10,height-100,20,-210)\n    triangle(width\/2,height-130,(width\/2)-20,height-100,(width\/2)+20,height-100)\n\n\n    \/\/GROUND COVER - CHANGES WITH EVERY HOUR- BECOMES MORE RED AS THE HOUR CONTINUES\n\n    var m = minute()\n    var g = map(m,0,60,0,255) \/\/ red for ground fill\n   \n    fill(g,255-g,0);\n    rect(0,height-100,width,100);\n\n\n\/\/recentering origin to the middle of the tree circle\n   translate(width\/2,height\/2.75);\n\n\n\/\/APPLE PICKER\n    var s1 = second()\n    var p = map(s1,0,60,-100,100) \/\/ changing position under the tree\n    fill(10)\n    rect(p,150,20,40);\n    ellipse(p+10,140,20);\n    strokeWeight(3);\n    stroke(10);\n    line(p+2,190,p,210)\n    line(p+18,190,p+20,210)\n    line(p,150,p-12,170)\n    line(p+20,150,p+33,170);\n   \n    \/\/basket\n    strokeWeight(1);\n    fill(255,255,140);\n    rect(p-15,170,50,20);\n\n\n\/\/ BRANCHES (STATIC)\n    stroke(100,60,0);\n    strokeWeight(6);\n   \n\n    line(0,0,150,0);\n    line(100,0,150,-30);\n    line(100,0,150,30);\n\n    line(0,0,-150,0);\n    line(-100,0,-150,-30);\n    line(-100,0,-150,30);\n\n    push(); \/\/top left quad\n    rotate(120);\n    line(0,0,150,0);\n    line(100,0,150,-30);\n    line(100,0,150,30);\n    pop();\n\n   push(); \/\/ top right quad\n   rotate(60);\n   line(0,0,150,0);\n     line(100,0,150,-30);\n    line(100,0,150,30);\n   pop();\n\n   push(); \/\/ bottom right quad\n    rotate(-60);\n   line(0,0,150,0);\n    line(100,0,150,-30);\n    line(100,0,150,30);\n   pop();\n\n   push(); \/\/ bottom left quad\n   rotate(240)\n   line(0,0,150,0);\n    line(100,0,150,-30);\n    line(100,0,150,30);\n   pop();\n\n\n\n\/\/APPLES\n\n    var s = second()\n    var rg = map(s,0,60,0,255) \/\/ changing color (red-green)\n    var x = 150\n    var r = .2 \/\/ fall rate\n\n    for (var i= 0 ; i &lt; 30 ; i++) {\n        \/\/base geometry for apples\n        rotate(15); \n        x -= r*sin(15);\n        noStroke();\n        fill(rg,255-rg,0);\n        ellipse(x,y,30,15);\n        ellipse(x-50,y,15,10);\n        \n        \/\/ falling geometry for apples (wilting)\n        if(s&gt;50 & s<60){\n            rotate(15);\n            noStroke();\n            fill(rg,255-rg,0);\n            ellipse(x,y,30,15);\n            ellipse(x-50,y,15,10);\n            x -= r*sin(15);\n            y+=r\n          }\n    }\n\n\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Graham Murtha Section A For this project, I wanted to document time with an apple tree\/ deciduous tree. As the minute passes, the leaves change color from green to red, and at the end of each minute wilt off and blow away. As the hour passes, the ground that the tree is on grows more &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/09\/project-06-abstract-clock-14\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 06- Abstract Clock&#8221;<\/span><\/a><\/p>\n","protected":false},"author":748,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[106,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/74180"}],"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\/748"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=74180"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/74180\/revisions"}],"predecessor-version":[{"id":74185,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/74180\/revisions\/74185"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=74180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=74180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=74180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}