{"id":569,"date":"2012-11-12T15:36:37","date_gmt":"2012-11-12T15:36:37","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=569"},"modified":"2012-11-12T15:36:59","modified_gmt":"2012-11-12T15:36:59","slug":"nature-rolling-hell-eggs","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/nature-rolling-hell-eggs\/","title":{"rendered":"Nature? Rolling Hell Eggs!"},"content":{"rendered":"<p>Click to make it go!<\/p>\n<p><script type=\"application\/processing\">\r\n\/\/Info: http:\/\/processingjs.org\/reference\r\nboolean clicking = false;\r\nboolean rclicking = false;\r\nPetal[] ps = new Petal[90];\r\nint numP = 0;\r\n\r\nvoid setup() {\r\n  size(1000, 800);\r\n}\r\n\r\n\r\nvoid draw() {\r\n  background(100);\r\n  if (mousePressed && (mouseButton == LEFT)) {\r\n    if (clicking == false && numP < ps.length){\r\n      ps[numP] = new Petal();\r\n      numP = numP + 1;\r\n      clicking = true;\r\n    }\r\n  }\r\n  else clicking = false;\r\n  \r\n  if (numP > 0) {\r\n    for (int i = 0; i < numP; i++) {\r\n       ps[i].update();\r\n    }\r\n  }\r\n}\r\n\r\n\r\nclass Petal {\r\n  float x = 0;\r\n  float y = 0;\r\n  int width = 10;\r\n  int height = 50;\r\n  int r = 0;\r\n  \r\n  Petal() {\r\n    x = mouseX;\r\n    y = mouseY;\r\n    ellipseMode(CORNER);\r\n  }\r\n  \r\n  void update() {\r\n    pushMatrix();\r\n    translate(x-(width\/2),y);\r\n    rotate(radians(r));\r\n    ellipse(0, 0, width++, height++);\r\n    popMatrix();\r\n    \r\n    r++;\r\n  }\r\n  \r\n}\r\n<\/script><\/p>\n<p>This was an accident. I made it while trying to make my second nature sketch. It looks like eggs constantly spinning towards you, in an unstoppable death march.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Click to make it go! This was an accident. I made it while trying to make my second nature sketch. It looks like eggs constantly spinning towards you, in an unstoppable death march.<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/569"}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=569"}],"version-history":[{"count":2,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"predecessor-version":[{"id":573,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/569\/revisions\/573"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}