{"id":67204,"date":"2021-10-09T12:58:43","date_gmt":"2021-10-09T16:58:43","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=67204"},"modified":"2021-10-09T12:58:43","modified_gmt":"2021-10-09T16:58:43","slug":"project-6-abstract-clock","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/09\/project-6-abstract-clock\/","title":{"rendered":"Project 6 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>It was alot of fun making this peice. It was really hard to figure out where to start, but when I decided to split the hour, minute, and second into different parts, I was able to better figure out what to do.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a class=\"p5_sketch_link\" data-width=\"480\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-38.js\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"480\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\nvar lengt = 10;\nvar hr;\nvar min;\nvar sec;\n\n\nfunction setup() {\n    createCanvas(480, 480, WEBGL);\n    hr = hour();\n    min = minute();\n    sec = second();\n    text(\"p5.js vers 0.9.0 test.\", 10, 15);\n    ellipse(240,240,480);\n}\n\n\n\/\/ drawing a plant that grows and dies at 24 hours but then grows from the stump again\n\nfunction draw() {\n  background(220);\n  sec = second();\n  min = minute();\n  sec = second();\n  thePlant(hr);\n  theSky(min,hr);\n  theLeaves(sec);\n}\n\nfunction theLeaves(second){ \/\/the leaves or flower changes based on the second\n  fill(\"purple\");\n  cone(10+second,65,16,3);\n}\n\nfunction thePlant (hr){ \/\/each hour adds length to the plant\n  fill(\"brown\");\n  translate(0,100);\n  cylinder(60, 100, 16, 16);\n  \n  \/\/the actual plant\n  translate(0,-70);\n  fill(\"green\");\n  cylinder(20, lengt*hr, 16, 16);\n}\n\nfunction theSky (min,hr){ \/\/changes based on the 12 hr system\n  if (hr &lt;= 12){\n    fill(0,0,0.3472*(min + (60*hr)));\n    }else{\n      fill(0,0,255 - 0.3472*(min + (60*hr)));\n    }\n  rect(-480,-480,960,960);\n}<\/code><\/pre><\/div>\n\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>It was alot of fun making this peice. It was really hard to figure out where to start, but when I decided to split the hour, minute, and second into different parts, I was able to better figure out what to do. sketch var lengt = 10; var hr; var min; var sec; function setup() &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/09\/project-6-abstract-clock\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 6 Abstract Clock&#8221;<\/span><\/a><\/p>\n","protected":false},"author":638,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[106,55],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67204"}],"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\/638"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=67204"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67204\/revisions"}],"predecessor-version":[{"id":67207,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67204\/revisions\/67207"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=67204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=67204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=67204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}