Sunday, April 18, 2010

Processing - Back to the drawing board (almost)

After spending a substantial amount of time trying to deconstruct and understand the 'Flies' sketch, I have come to the decision that I am no longer going to base my sketch around the swarm mechanic. This was due to two main reasons, firstly I feel I haven't spent enough time with 'Processing' to be able to understand how this works, even though I could bend the existing sketch to fit my purpose, and secondly, linked to this point is the fact that to make my sketch work in the way I intended it to I would have to 'borrow' too much of the pre-existing code, and therefore it wouldn't feel, or be my own work.

So after looking back at my original idea, I wanted to find a way I could still achieve that concept with the ability level and skill set I have. I still wanted to use the outside temperature and wind speed to visualise a molecule simulation representation, and still wanted the same governing rules for behaviour, the only difference would be to replace the actual swarm mechanic with something I could achieve myself.

The substitute I settled on was instead of having x amount of particles moving around the stage, I would have them appear, and disappear every couple of seconds so that it isn't just static, and does appear animated. This is achieved simply by adding a count to the draw function, and an if statement so when the count reaches 50 it resets, with a frame rate of 25, this is every 2 seconds. Combine this with the fact that I am doing a representation of molecules, with are basically circles, the simple mechanic both works and is easy to achieve. The rules which apply to the circles is where the simulation steps up a gear.

There are four main attributes which work together to finalise the visualisation. These are, the size of the circles, the position and area these circles take up on the stage, the colour of the circles, and finally the opacity of the circles. The first three are all to do with the temperature outside. Once the temperature is converted into a number Processing can use, it then determines which conditional statement is true, and applies general settings to do with the outside temperature. There are five different possible outcomes, where the temperature between 0℃ and 20℃, is divided into 4℃ ranges, and this affects the colour of the circles, ranging from blue (coldest) to red (hottest), the size of the circles, small for cold, larger for hot, and the area in which they appear, a small grouping in the centre for coldest, and a spread across the whole stage for the hottest. These circles do not appear in set positions, within each conditional statement is built in randomisers which ensure the circles attributes stay within the conditions, but are based on the information from the arch-os and sketch setup, so that each set of fifty 'molecules' are different from the last and not just one of five animations being played.

The final condition of opacity is taken directly from the wind speed. The circles are more opaque the higher the windspeed, and the logic behind this is that even though the temperature maybe 20℃ outside, if you were to look at the circles and they were faint in appearance, there would be high wind outside which adds to the chill, and takes away from the overall temperature.

Even though this may seem overly complicated to explain, I think these attributes add to the final product, and is a much more interesting way of representing the same data rather than just having a blue circle for cold, and a red circle for hot. I wanted it to be based 'loosely' on the way molecules interact whilst heating and cooling, with the more energy (heat) they have the more they disperse. With the colouring and opacity there to add to, and reinforce some points.

The pictures below are from the sketch running and show Plymouth on a hot windy day, and on a cold day with no wind. As you can see I have also added a title, key, and some of the actual data into the sketch. This was for two reasons firstly, I feel it makes the piece look more professional, and secondly, as I have already mentioned I am very practical so I would want a key and title to understand, and show that these appearing circles have a purpose.



No comments:

Post a Comment