For my visualisation, I have decided to do a bouncing ball, which is influenced by the values of the first digit of the data captured from Arch-OS's Atrium A Heat Flow sensor in the Portland Square Building of the University. Because I wanted the illustration to represent the flow of the heat (hence the name of the sensor that I chose to use in my visualisation), I looked into pre-existing examples of data visualisations (http://vimeo.com/15088939) before deciding to go down the simpler route for my visualisation.
The data is first taken from the RSS feed using XMLElement in Processing, then the value of the data is taken from the 'description' child of the RSS using "value = xml.getChildren("channel/item/description");". The term 'child' in this context refers to a subsection within a 'parent', which in turn refers to the root of the RSS. The colour also varies according to the values of the RSS data, which varies between darker shades of red and grey depending on how high or how low either values are in each of the RGB attributes of the circle colour property.
The values are then parsed as floating-point integers, which is then used to create values which will be used for the random positioning and the colour properties by getting the content from value and then using charAt to obtain the indexes of the digits:
float v = int(value[i].getContent().charAt(1));
float v2 = int(value[i].getContent().charAt(2));
float v3 = int(value[i].getContent().charAt(3));
float v4 = int(value[i].getContent().charAt(4));
Then, the values are added to the attributes:
fill(v,v2,v3);
ellipse(ceil(random(0,v)) * 8, height/2 + 20, 50,50);
Note that the ellipse uses 'ceil' to round up a random number and the number obtained from the first index of the value (v) to the nearest whole integer, then it is multiplied by 8 to create the X value, and then the Y value is created by dividing the height by 2 and adding that by 20. The result, depending on the RSS value on a given day, is a ball that bounces left and right in rapid motions.
This is the entire source code of the project:
import processing.xml.*;
XMLElement xml;
XMLElement[] title;
XMLElement[] pubDate;
XMLElement[] value;
void setup(){
size(600,100);
background(0);
smooth();
String url = "http://x2.i-dat.org/archos/archive.rss?source=.AtriumA_heating_flow";
XMLElement xml = new XMLElement(this, url);
title = xml.getChildren("channel/item/title");
pubDate = xml.getChildren("channel/item/pubDate");
value = xml.getChildren("channel/item/description");
}
void draw(){
background(255);
for(int i=1; i<value.length; i++){
float v = int(value[i].getContent().charAt(1));
float v2 = int(value[i].getContent().charAt(2));
float v3 = int(value[i].getContent().charAt(3));
float v4 = int(value[i].getContent().charAt(4));
fill(v,v2,v3);
ellipse(ceil(random(0,v)) * 8, height/2 + 20, 50,50);
}
}
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Designed with ease of use in mind, the interface is inspired by mobile tablet devices, namely the iPad, and also, some of the principles o...
-
For our first project of DAT204, we have to create a 'killer' web application based on the latest web standards (HTML5 etc.) and sem...
-
Inspired by ®™ark's Barbie Liberation Organization campaign of the early 1990s, I decided to add a section to Project Canterlot by looki...
-
During the course of a few weeks, we've been doing some Adobe Illustrator stuff. Part of our assignment is to design a digital signature...
-
As unconventional as it may seem, interventions are a great way to get the message out there. From urinating on sculptures resembling urinal...
-
There seems to be problems with existing information kiosks being underused, and this could be down to the fact that there is not enough fun...
-
Whilst we were planning on how we're going to implement the interface, the idea we had was to design the interface like a tablet compu...
-
As part of our assignment for the Creative Industries module, we were given a task to produce an educational application for a charity that ...
-
Since the release of the miniature Raspberry Pi system last week, this has given an idea of cutting down the footprint and cost for the info...
-
So, this wraps up the artefact, just like Winter Wrap Up, except that is not Winter Wrap Up anymore, this is Spring. After working hard for ...
No comments:
Post a Comment