The latest tree version. This time I’m generating the nodes all in one go, rather than onEnterFrame and then drawing them all together – it’s a much bigger processor hit, but I get to play with all the points if I want to (will be obvious why in the next revision). Click to generate a tree and drag the sliders to change the properties of the tree. I’ve tried to make sure that it doesn’t max out the processor, but be careful at high branch numbers/generations!
source code here
[kml_flashembed movie="wp-content/experiments/drawing/treePreGen.swf" height="500" width="500" /]
Archive for November, 2007
Experiment #5 : Pregenerated tree
Tuesday, November 27th, 2007Experiment #4 : Vertical tree
Sunday, November 25th, 2007A new version of the fractal tree code. This version has only 2 real differences – the length of the segments is now randomised and also the rotation of each branch now tends towards being vertical. Also it has leaves
source code here Click below to generate
[kml_flashembed movie="wp-content/experiments/drawing/tree2.swf" height="400" width="500" /]
Experiment #3 : Noise generator
Tuesday, November 20th, 2007So a week later and I haven’t posted anything new – so much for 1 experiment each day! Anyway. There was a discussion on flash brighton about Perlin Noise, inspired by Robert Hodgin’s processing work. Robert’s stuff uses a 3d Perlin noise class and unfortunately Flash only does 2d. Seb Lee-Delisle has been doing some experiments using a custom Perlin Noise class, by Ron Valstar. I decided to roll my own
Now, what I’ve come up with has a few problems – first of all you can’t reproduce it using a seed value, as it generates randomly. Secondly it is pretty processor intensive, but actually less so than Ron’s version.It doesn’t really do low noise values very well, which is what is so nice about Perlin noise. Lastly, it isn’t really ‘3d’ – there would be no way to generate a 3d object that you could move around using this class.
The way it works is to generate a point cloud with a depth of 32. These points are added to a bitmap, using the z depth of the point to specify the colour of the pixel, from black to white and back again. When a pixel is added, it checks the value of the pixel underneath and adds the value of the new pixel before resetting the pixel value. Finally it adds a blur to the whole bitmap.
I’ve got a couple of ideas of how to improve it. Firstly, the code has to draw each pixel in turn, where it may be an idea to calculate the values first and then draw the pixels – I’m guessing this will only affect high noise values, but that’s where the speed is needed. It would also be nice to use an algorithm rather than Math.random to set the point positions, which could potentially lead to a true 3d version.
Anyway source. click to start/stop:[kml_flashembed movie="wp-content/experiments/noise/noise3d.swf" height="200" width="300" /]
Experiment #2 : Tree version 1
Thursday, November 8th, 2007My first tree generator. Again, click to reset, source code. sweet.
[kml_flashembed movie="wp-content/experiments/drawing/tree.swf" height="400" width="500" /]
Experiment #1 : Inkscape
Thursday, November 8th, 2007So, in my new inspired state, I’m going to try to make an flash experiment each day and post it up here.
Here’s my first one, which is supposed to look like those ink wash landscapes you get in Japanese art. Click to generate a new image.
[kml_flashembed movie="wp-content/experiments/drawing/inkscape.swf" height="250" width="500" /]
The source code is available here: inkscape
Flash on the Beach ‘07
Thursday, November 8th, 2007It’s the day after FOTB and I’ve just about recovered from my hangover, so I thought I should jot some stuff down before I forget what happened. Last year I couldn’t go (despite Brighton being my home town) but did manage to get to some of the parties and from the buzz I was getting from everyone, I was really looking forward to going this year. The timing was also really good, as I felt like I had been getting into a rut – working on projects that just weren’t floating my boat, and I needed some inspiration. I was not disappointed!
So, what did I see?
Some good, some great and some freakin awesome!
(more…)