{"id":451,"date":"2012-11-12T02:29:35","date_gmt":"2012-11-12T02:29:35","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=451"},"modified":"2012-11-12T02:29:35","modified_gmt":"2012-11-12T02:29:35","slug":"nature-vs-machines-night-light-2-will-o-the-wisps","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/nature-vs-machines-night-light-2-will-o-the-wisps\/","title":{"rendered":"Nature vs Machines, Night &#038; Light 2: Will o&#8217; the Wisps"},"content":{"rendered":"<p>The second of my &#8220;Night &amp; Light&#8221; sketches is based on will o&#8217; the wisps, ghostly lights supposedly seen by travelers at night that lead them on safe paths over swamps and marshes in English folklore.<\/p>\n<p>The two will o&#8217; the wisps dance around each other naturally, but will also dance in time as you move your mouse around the canvas. Try it! You&#8217;ll need to hover your mouse over it to get them started.<\/p>\n<p>&nbsp;<\/p>\n<p><script type=\"application\/processing\">\r\n\/\/initializing\r\nfloat xtime = 0.0;  \r\nfloat ytime = 100.0;\r\nfloat increment = 0.02; \r\n\r\nfloat atime = 0.0;\r\nfloat btime = 100.0;\r\nfloat inc = .01;\r\n\r\nint centX = width\/2;\r\nint centY = height\/2;\r\n\r\n\/\/main setup\r\nvoid setup()  {   \r\n  size(200,200);  \r\n  smooth();\r\n  background(42); \r\n \/\/noCursor(); \r\n}   \r\n\r\n\/\/main draw\r\nvoid draw() {   \r\n  \r\n  float x = noise(xtime)*mouseX;  \r\n  float y = noise(ytime)*mouseY;\r\n  \r\n  float a = noise(btime)*mouseY;  \r\n  float b = noise(atime)*mouseX;  \r\n  \r\n  \/\/increments\r\n  xtime += increment;  \r\n  ytime += increment;  \r\n  \r\n  atime += inc;  \r\n  btime += inc; \r\n  \r\n  color aura;\r\n aura = color(145,225,255);\r\n  \r\n \/\/ int rcol;\r\n  int gcol;\r\n  int bcol;\r\n  int rcol;\r\n  \r\n \/\/ rcol = int(x+100);\r\n\/\/  constrain(rcol, 30,70);\r\n  bcol = int(noise(a)+100);\r\n  rcol = int(noise(b)+100);\r\n  gcol = int(a+140);\r\n  constrain(gcol,185,255);\r\n  \r\n  \/\/willowisps \r\n  \r\n  \/\/aura 1\r\n  noStroke();\r\n \r\n fill(rcol,y+100,x+y+100,100);  \r\n  ellipse(x,y,16,16);\r\n  \r\n  \/\/center 1\r\n  fill(255,255,255,150);\r\n  ellipse(x,y,4,4);  \r\n  \r\n  \/\/aura 2\r\n  fill(gcol,b+60,a+b+120,100);\r\n  ellipse(a,b,16,16);\r\n  \r\n  \/\/center 2\r\n  fill(255,255,255,125);\r\n  ellipse(a,b,4,4);\r\n  \r\n  \/\/background fade draw\r\n  stroke(0);\r\n  strokeWeight(1);\r\n  fill(42,3);\r\n  rect(0,0,width,height);\r\n  \r\n}    \r\n\r\n\r\n\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The second of my &#8220;Night &amp; Light&#8221; sketches is based on will o&#8217; the wisps, ghostly lights supposedly seen by travelers at night that lead them on safe paths over swamps and marshes in English folklore. The two will o&#8217; &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/nature-vs-machines-night-light-2-will-o-the-wisps\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":10,"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\/451"}],"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\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=451"}],"version-history":[{"count":1,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":454,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/451\/revisions\/454"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}