Shuffle Grid Demo

Drag & Drop the images to shuffle them around… Read : AS3 Shuffle Grid Class »

Posted on 04 Mar 2009
67 Comments
13 Trackbacks
“Easily create two sided 3D DisplayObjects and flip card effects using Flash Player 10 and the new 3D API …”

PaperSprite Demo

I’ve made a couple of small improvements to the PaperSprite class:

  1. The visible face of the plane is updated automatically only when required. This saves on processing load and also means you can just set up the PaperSprite and not have to worry about anything else, just tween the crap out of all its properties and it won’t mind one bit. (Thanks to Jesse for the pointers re. using stage.invalidate for this process)
  2. The back face is now automatically flipped horizontally, so text and graphics are no longer mirrored and will display correctly
  3. I’ve changed the logic which sets the dynamic registration point for the pivot. This should now correctly line up the front and back faces of the 3D plane, regardless of where their individual registration points are.

Also, some people have asked how to use it, so here is a really quick example to get you up and running with PaperSprite if you are not familiar with using classes and are using the Flash IDE to compile your movie:

  1. First, download the PaperSprite class and put the soulwire folder in the same directory as your FLA or source code.
  2. Then paste this code into the main timeline of your FLA:

Read : Double Sided 3D Plane in FP10 »

Posted on 30 Dec 2008
108 Comments
11 Trackbacks

Flow Field with Perlin Noise

It was a rainy Sunday and I found myself playing around with perlin noise for a couple of hours.

The idea was to create a simple flow field using the BitmapData perlinNoise method, and use this to influence the movement of autonomous agents. There is no complex vector math or steering behaviours, just some simple logic for how a particle or agent reacts to the current pixel it is positioned over. Read : Perlin Noise Flow Field »

Posted on 14 Dec 2008
30 Comments
6 Trackbacks

Bitmapdata Colour Palette

My previous post explained and provided a very simple method for extracting colours from a BitmapData image, by averaging the colours in specific areas. This can have several applications, for example it features in a large amount of prototypes for the update to my Motion Tracking engine. However, if you want to create an accurate and representative colour palette from an image it has several flaws, the most obvious being that by averaging colours, you are actually removing or diluting the striking but perhaps less frequent colours in the image – the very colours which often make an image’s colour palette so exiting!

So, if we’re to extract an exciting and more representative palette from an image, we need a more intelligent algorithm; one which takes into account what makes a colour palette interesting – the contrasts and juxtapositions of colours within the image. Read : BitmapData Colour Palette »

Posted on 11 Oct 2008
55 Comments
15 Trackbacks

BitmapData Average Colours

If you want a very simple way of extracting a colour palette from an image, one technique would be to average the colour values within specific areas. Averaging colour values is almost identical to averaging numbers, except with the added initial step of finding the red, green and blue components of the colour. To do this we can use bitwise operators, in this case bitwise shift, to perform fast operations on each bit inside the unsigned integer returned by getPixel or getPixel32. If you want to know more about bitwise operators, Moock has written a detailed and, as ever, very clear article on where, when and why to use bitewise operations. You can read it here.

So once you’re familiar with how to shift the bits of an integer, you can easily get the RGB values from a 24 bit hexadecimal by moving the bits to the right by a certain amount using the bitwise right shift operator (>>). Read : BitmapData Average Colours »

Posted on 10 Oct 2008
26 Comments
12 Trackbacks

About me

Soulwire is a weblog by Justin Windle; a Senior Interactive Developer at Fi (Fantasy Interactive), Stockholm – I often Tweet, Flik, Link and Vim.

Warning: file_get_contents(http://search.twitter.com/search.atom?q=from:soulwire&rpp=1) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 410 Gone in /home/soulwire/webapps/soulwire_blog/wp-content/themes/soulwire/functions.php on line 203