Wednesday, 6 June 2012

Creative Coding, Project Three, Blog Ten

Since my last developments I have been experimenting with snowflakes exploding. I first made it so they explode once they have reached a certain speed by having the distance between the shapes constantly increasing.

However I wanted to add a few more features to it, such as what I had previously, being the trembling of the snowflakes just before they explode.

So I tried doing this again, however since the snowflakes were already rotating, it added the increase of the x and y co-ordinates which creates the shape form the central point however it still rotated around the original point meaning the orbited around a point they didn't spin around the central snowflake position.

This is what is happening in the image below.
Crazy rotations!
In the next image below shows the same thing except quite are few are exploding...

In order to fix this (or more make it less crazy) I simply reduced the amount it could shake by, so now this still happens but it is so small it just creates they amount of shakage I want but does not make a mess.

Here are the remaining snowflakes that haven't exploded and now their rotation point is not distorted.
I then looked at adding another feature to the explosion, having the shape size increase just as they're about to explode. I think this enhances the exploding idea, as quite often when things inflate too much they explode, thus the growing complements the action.
Here I have the shape size grow just before they explode.
I also made it so if the mouse runs back over an inflated snow flake the size will decrease back down to original size to show it has been reversed, I also wanted to have a reversal not just a snap back to the original size so it is more fluid.
Here some of the inflated snowflakes have exploded.

After creating the explosions I then looked at bringing colour back to my application. I first looked at the background colour, having it fade into different shades in relation to the mouse speed. I learnt a new function which is used for fading colours from one to the other called 'lerpColor'.
Here is an example from my code of using lerpColor, I have two colors 'col1' and 'col2' then another variable 'speed[i]' which holds the value in how much of each colour it will use, thus if it changes the colour will change/fade.
However for my background exploration I ended up making it so the background colour faded to a colour dependent on where it was on the screen, I had the colours fading between white and red but ended up with some odd colours in between as you can see by the following images...
Orange

Grey

Purply Grey
I then decided my background colour did not need to change in order to enhance the interaction so I decided to have it as a dark blue to complement the white colour of my snowflakes and give the idea of 'cold' as it is when you have snowflakes.

For my snowflakes colour I decided to have them white while they are still but then when they rotate the begin to fade into red, so the faster they got the reder they get until they explode. I thought red was suitable with my concept as it represents heat as opposed to a cool blue or white.
Here are my snowflakes glowing red before they explode.
A handy tool I discovered that Processing has is the Color Selector, which is useful to find out the values of the colours...
Color Selector
Another feature I wanted to add was to have the snowflakes respawn after they explode, so the application never ends. I did this by having it that after a certain amount of time they reappear, I then added it so they fade back in. I also made it so that in the beginning the snowflakes slowly fade in before they start.
Here the snowflakes are fading back in after previously exploding.

Again more snowflakes respawning
After doing all of this I looked at my application to see if I found it fun. I decided that since I had inverted it seemed less fun as by interacting with it the snowflakes stop and the action freezes, watching the snowflakes explode on their own accord seemed much more fun that bothering to interact.

So I have since been looking at ways to make the interaction more worthwhile. I have been looking at having a second layer of shapes appear in the snowflake when the mouse is in range.

In the image below I had just added the extra layer to all snowflakes no matter what range they were from the mouse, I made them a yellow colour...
I then looked at making it so they pulse inside the snowflake but only when the snowflake is stationary otherwise it fades away. In terms of the colour I made it fade between red and white, white when it is most spread and red when it is compressed in the centre. I also learnt a new feature which makes pulsing movements much easier, the function 'sin' or 'cos' which puts the increasing value into a sin or cos wave so it instead alternates between -1 and 1. This was the result....
Pulsing inner layers.
I then decided shades of red were not the right colour as in this case red is heat and when the snowflake is stationary it should be cool, so I instead made the colour a light blue.
Light blue inner layer
I still thought that even with this it wasn't that interesting so I decided to make it that each snowflake has it's own individual shade of blue inner pulsing layer...
However after experimenting with this I found it was not that interesting. So I then looked at having the inner layers beat faster when the mouse was near, at first I made it a little too fast but now I have it as a speed I like and I think I will keep this.

I have now re-looked into my idea of them being snowflakes and this whole heating and cooling idea and have decided that the mouse could take the role of a freezer, when it runs over the snowflakes it freezes them restoring them to white and freezing them still, and now additionally I want them to freeze further into an ice-cube, meaning the shape size will grow until it is completely inflated into a cube. Additionally the pulsing inner layer has become a snowflake heart, which looks as if it pumps it up, you really have to play with the application to get what I mean. However I want to have it so once the mouse moves away it melts back to its original sizes then spins turning red and explodes.
Here's what I have accomplished based on this ides so far.
I am now going to further this develop idea more and also look at having the snowflakes transparent as it looks more awesome.

No comments:

Post a Comment