Wednesday 14 April 2010

Change of idea and XML!


After messing around with a few simple sketches i decided not to bother with "bms_.OutAirHum" from the RSS feed. I looked over the course of 5 days and saw that it doesn't change much. So instead im going to use "bms_.WindSpeed" which does change considerably.


I found importing this to processing was no difficult task by using this code...


import processing.xml.*;


XMLElement xml;
XMLElement[] title;
XMLElement[] pubDate;
XMLElement[] value;

followed by this in the setup...


String url = "http://x2.i-dat.org/archos/archive.rss?source=bms_.WindSpeed";
XMLElement xml = new XMLElement(this, url);
title = xml.getChildren("channel/item/title");
pubDate = xml.getChildren("channel/item/pubDate");
value = xml.getChildren("channel/item/description");

To see if the data was entering processing  i used the "println" function so that i could view the data in the output window. Great that was all working, now the hard part what to do with this data?


So i wanted to make my visualisation a bit more advanced. Something cool to look at. However my processing knowledge DID lack. However this site http://www.learningprocessing.com/     has helped me and im sure many others with this assignment.


My idea in my head was simple, create a tornado in processing! The hard way of doing this would obviously be a mass particle swarm turning and changing in speed depending on the windspeed.

The easy way? a series of ellipses turning close together, making it also look like a fan on a A/C unit.

No comments:

Post a Comment