Wednesday 14 April 2010

The sketch takes shape!


Before i started to design my sketch i penned down a few visual targets...



  1.  Use colour scheme of my website (www.busy-signal.co.uk) to great effect.


  2. Have a personal message for each condition of the wind speed. i.e if the wind speed is high display " High wind speed ".


  3. Use a series of ellipses to circle each other creating a wind over the sketch
Numbers one and two were very simple, i learnt i could include colour references inside processing e.g. background(#77b2f5), very simple!


However number 3 was the hard part. It required the use of tutorials, new functions and a cheeky bit of curve making.


Here is my starting setup ..
import processing.xml.*;

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




void setup() {
frameRate(10);
smooth();
size(300,300);
background(#77b2f5);


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");

}

Now obviously one ellipse rotating is not going to look good or look anything like a tornado so i decided to use 3, which means declaring 3 float variables an assigning each ellipse a different id.


float z = 255;
float x = 255;
float y = 255;


I knew i had to have an if statement to give two or more different experiences of the sketch depending on the wind speed, but the hard part was trying to figure out how to make the circles rotate and move across the screen.




No comments:

Post a Comment