{"id":636,"date":"2012-11-15T03:08:57","date_gmt":"2012-11-15T03:08:57","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=636"},"modified":"2012-11-15T03:08:57","modified_gmt":"2012-11-15T03:08:57","slug":"the-great-lights-in-the-sky-in-nature-vs-machine","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/15\/the-great-lights-in-the-sky-in-nature-vs-machine\/","title":{"rendered":"The Great Lights in the Sky &#8211; in &#8211; Nature vs. Machine"},"content":{"rendered":"<p>I first thought of making a triangle and doing a rip off of the famous Pink Floyd cover. But I didn&#8217;t want that. So my mind went from light deflecting off prisms to light hitting elements in the sky. The natural show is called an aurora and there is one in both the Southern and Northern hemispheres, australis and borealis. The impressive lighting appears due to solarwind hitting which excite the atoms in the air causing the release of light as their excitation state is normalized. The different colors are produced by specific elements or mixture of elements. The main atoms are nitrogen, which releases green, and oxygen, which releases red. The color combinations are more or less likely depending on altitude of the action. Usually red is more common up high and green is more common lower down. I added in this fact into the elements of my sketch.<\/p>\n<p>By dragging in across the night sky you can produce your own aurora in the air.<br \/>\nYou can hit the enter key to clear the sky if you want to clear the night again.<\/p>\n<p><script type=\"application\/processing\">\r\n\/\/Info: http:\/\/processingjs.org\/reference\r\n\/\/ Aurora Borealis\r\n\/\/ \r\n\/\/ By: Alex Clemens\r\n\/\/\r\n\r\n\r\ncolor BG_Color = color( 23, 0, 23 );\r\nint R_Value = 255;\r\nint G_Value = 255;\r\nint Pink_R_Value = 175;\r\nint Pink_G_Value = 127;\r\nint B_Value = 200;\r\n\r\nint R_ColorValue;\r\nint G_ColorValue;\r\nint B_ColorValue;\r\n\r\nint preLineLen = 900 \/ 10;\r\nboolean shouldDraw = false;\r\nint lightDirection = 0;\r\n\r\n\r\nvoid setup()\r\n{\r\n  size( 900, 500 );\r\n  background( BG_Color );\r\n  frameRate( 600 );\r\n  noStroke();\r\n  fill( 15, 5, 20, 172 );\r\n  ellipse( width\/2, height, width*4\/3, height*2\/3 );\r\n  \r\n}\r\n\r\nvoid keyPressed()\r\n{\r\n  setup();\r\n}\r\n\r\nvoid draw()\r\n{\r\n if( shouldDraw )\r\n {\r\n  int lineLen, x2 = 0, y2 = 0;\r\n  \r\n  lineLen = int( random( height \/ 4 ) );\r\n  \/\/ average the previous length with the new one\r\n  lineLen = int( ( lineLen + preLineLen ) \/ 2 );\r\n  \r\n  \r\n  \/\/ Set up line location\r\n  if ( lightDirection == 2 )\r\n  {\r\n    x2 = mouseX;\r\n    y2 = mouseY - lineLen;\r\n    \/\/ bottom layer\r\n  R_ColorValue = int( ( R_ColorValue + random( Pink_G_Value ) \/  - random( Pink_G_Value ) \/ 2 ) );\r\n  G_ColorValue = int( ( G_ColorValue + random( Pink_G_Value ) \/ 2 - random( Pink_G_Value ) \/ 3 ) );\r\n  B_ColorValue = int( ( B_ColorValue + random( B_Value ) \/ 2 - random( B_Value ) ) * 2 \/ 5 );\r\n  }\r\n  \r\n   if ( lightDirection == 4 )\r\n  {\r\n    x2 = mouseX;\r\n    y2 = mouseY + lineLen;\r\n    \/\/ second to bottom\r\n  R_ColorValue = int( ( R_ColorValue + random( Pink_G_Value ) - random( Pink_G_Value ) ) );\r\n  G_ColorValue = int( ( G_ColorValue + random( Pink_G_Value ) - random( Pink_G_Value ) \/ 2 ) );\r\n  B_ColorValue = int( ( B_ColorValue + random( B_Value ) \/ 2 - random( B_Value ) \/ 2 ) \/ 2 );\r\n  }\r\n  \r\n  if ( lightDirection == 3 )\r\n  {\r\n    x2 = mouseX;\r\n    y2 = mouseY - lineLen;\r\n    \/\/ second to top layer\r\n  \/\/ Set up color scheme\r\n  R_ColorValue = int( ( R_ColorValue + random( Pink_R_Value ) \/ 2 - random( Pink_G_Value ) \/ 2 ) );\r\n  G_ColorValue = int( ( G_ColorValue + random( Pink_G_Value ) * 2  - random( Pink_R_Value ) * 2 ) );\r\n  B_ColorValue = int( ( B_ColorValue + random( B_Value ) \/ 2 - random( B_Value ) \/ 2 ) \/ 2 );\r\n  }\r\n  \r\n  if ( lightDirection == 1 )\r\n  {\r\n    x2 = mouseX;\r\n    y2 = mouseY + lineLen;\r\n    \/\/ top layer\r\n  \/\/ Set up color scheme\r\n  \r\n  R_ColorValue = int( ( R_ColorValue + random( Pink_R_Value ) * 1.5 - random( Pink_R_Value ) ) );\r\n  G_ColorValue = int( ( G_ColorValue + random( Pink_R_Value ) \/ 3 - random( Pink_R_Value ) ) );\r\n  B_ColorValue = int( ( B_ColorValue + random( B_Value )  - random( B_Value )  ) * 2 \/ 5 );\r\n  }\r\n  \r\n  \r\n  CheckRGBvalues();\r\n  \r\n  stroke( R_ColorValue, G_ColorValue, B_ColorValue, 10 );\r\n  strokeWeight( 10 );\r\n  \r\n  line( mouseX, mouseY, x2, y2 );\r\n }\r\n  \r\n}\r\n\r\n\r\nvoid mousePressed()\r\n{\r\n\r\n  if ( mouseY > ( height * 3 \/ 4 ) )\r\n  {\r\n  lightDirection = 2;  \r\n  \r\n  R_ColorValue = int( random( R_Value ) );\r\n  G_ColorValue = int( random( G_Value ) );\r\n  B_ColorValue = int( random( B_Value ) - random( B_Value ) );\r\n\r\n  \/\/ Check that values are not negative\r\n  CheckRGBvalues();\r\n  \r\n  }\r\n  \r\n \r\n  else if ( mouseY <= ( height * 3 \/ 4 ) && mouseY > ( height * 2 \/ 5 ) )\r\n  {\r\n  lightDirection = 4;\r\n    \r\n  R_ColorValue = int( random( R_Value ) - ( random( Pink_R_Value ) \/ 2 ) );\r\n  G_ColorValue = int( random( G_Value ) );\r\n  B_ColorValue = int( random( B_Value ) );\r\n  \r\n  \/\/ Check that values are not negative\r\n  CheckRGBvalues();\r\n  }\r\n  \r\n  \r\n  else if ( mouseY <= ( height * 2 \/ 5 ) && mouseY > ( height \/ 6 )  )\r\n  {\r\n  lightDirection = 3;  \r\n  \r\n  R_ColorValue = int( random( R_Value ) );\r\n  G_ColorValue = int( random( G_Value ) );\r\n  B_ColorValue = int( random( B_Value ) - random( B_Value ) );\r\n\r\n  \/\/ Check that values are not negative\r\n  CheckRGBvalues();\r\n  \r\n  }\r\n  \r\n  \r\n  else if ( mouseY <= ( height \/ 6 ) )\r\n  {\r\n  lightDirection = 1;\r\n    \r\n  R_ColorValue = int( random( R_Value ) - ( random( Pink_R_Value ) \/ 2 ) );\r\n  G_ColorValue = int( random( G_Value ) );\r\n  B_ColorValue = int( random( B_Value ) );\r\n  \r\n  \/\/ Check that values are not negative\r\n  CheckRGBvalues();\r\n  }\r\n  \r\n  shouldDraw = true;\r\n}\r\n\r\nvoid mouseReleased()\r\n{\r\n  shouldDraw = false;\r\n}\r\n\r\n\r\n\/\/ Checks that values are not negative\r\n\r\nvoid CheckRGBvalues()\r\n{\r\n  \r\n if( R_ColorValue < 0 )\r\n {\r\n   R_ColorValue = R_ColorValue * (-1);\r\n }\r\n  if( G_ColorValue < 0 )\r\n {\r\n   G_ColorValue = G_ColorValue * (-1);\r\n }\r\n  if( B_ColorValue < 0 )\r\n {\r\n   B_ColorValue = B_ColorValue * (-1);\r\n }\r\n \r\n if( R_ColorValue > 255 )\r\n {\r\n   R_ColorValue = 245;\r\n }\r\n  if( G_ColorValue > 255 )\r\n {\r\n   G_ColorValue = 245;\r\n }\r\n  if( B_ColorValue > 255 )\r\n {\r\n   B_ColorValue = 245;\r\n }\r\n \r\n}\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I first thought of making a triangle and doing a rip off of the famous Pink Floyd cover. But I didn&#8217;t want that. So my mind went from light deflecting off prisms to light hitting elements in the sky. The &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/15\/the-great-lights-in-the-sky-in-nature-vs-machine\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":14,"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\/636"}],"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\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=636"}],"version-history":[{"count":5,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/636\/revisions"}],"predecessor-version":[{"id":641,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/636\/revisions\/641"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}