{"id":530,"date":"2012-11-12T15:14:51","date_gmt":"2012-11-12T15:14:51","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=530"},"modified":"2012-11-12T15:15:32","modified_gmt":"2012-11-12T15:15:32","slug":"jayson-corey-project-1-spawnflower","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/jayson-corey-project-1-spawnflower\/","title":{"rendered":"Jayson Corey Project 1: SpawnFlower"},"content":{"rendered":"<p>Inspired by flowers and strobe lights, this program is designed to let you see a bunch of possible flower designs really quickly against flashing backgrounds and give you the power to summon glorious walls of light in short bursts. This project is a byproduct of me screaming at another program for this project that refused to do what I wanted it to do, and me wanting to make a lot of flashing rainbow colors that are randomly generated and highly obnoxious. Press any key to cause the display to flash a rainbow color at random. Enjoy!<\/p>\n<p>Also, it tends to run a lot faster in this blog than it should actually run. That ultimately makes the flashes you cause more subtle and hurts the interactivity, and makes some odd effects with lines. But it also makes the program a bit more humorous. Trade offs.<\/p>\n<p><script type=\"application\/processing\">\r\nPFont f;\r\n\r\nvoid setup () {\r\n  size (250, 250);\r\n  background (0, random(127, 255), random(49, 72)); \r\n  strokeWeight (5);\r\n  smooth ();\r\n  f = createFont(\"Helvetica\",16,true); }\r\n\r\nvoid draw() {\r\n  float radius = 1;\r\n  int centX = 125;\r\n  int centY = 125;\r\n\r\n  stroke (0, 30);\r\n  noFill ();\r\n  ellipse (centX, centY, radius*2, radius*2);\r\n\r\n  stroke (random (200, 255), random (174, 214), random (14, 56)); \r\n  radius = 5;\r\n  float x, y;\r\n  float lastx = -999;\r\n  float lasty = -999;\r\n  float radiusNoise = random (50);\r\n    \r\n    for (float ang = 0; ang <= 1440; ang += 10) {\r\n      radiusNoise += 1;\r\n      radius += 0.5;\r\n    float thisRadius = radius + (noise (radiusNoise) * 200) - 100;\r\n    float rad = radians (ang);\r\n    x = centX + (thisRadius * cos(rad));\r\n    y = centY + (thisRadius * sin(rad));\r\n    fill (random(255), random(255), random(255), 10);\r\n    rect (0, 0, width, height);\r\n  \r\n    if (lastx > -999) { line(x, y, lastx, lasty); }\r\n    \r\n    lastx = x;\r\n    lasty = y;\r\n    fill (0);  \r\n    textAlign(LEFT);\r\n    text(\"SpawnFlower, by Jayson Corey.\", 12, 224);\r\n    text(\"Press any key to cause flash.\", 12, 240); } }\r\n  \r\nvoid keyPressed() {\r\n  fill (random(255), random(255), random(255), 255);\r\n  rect (0, 0, width, height); }\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inspired by flowers and strobe lights, this program is designed to let you see a bunch of possible flower designs really quickly against flashing backgrounds and give you the power to summon glorious walls of light in short bursts. This &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/jayson-corey-project-1-spawnflower\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":15,"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\/530"}],"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\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=530"}],"version-history":[{"count":3,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/530\/revisions"}],"predecessor-version":[{"id":554,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/530\/revisions\/554"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}