Close Show/hide page

{zero point nine} personal experiments, etc.

A Papervision 2.0 alpha example

Thumbnail - Click me Click to run demo

I drew up this example a few weeks ago to learn about the new features in Papervision 2.0 alpha. If you're thinking of looking into the new version, then hopefully you'll find the supplied source code below of some use. I used the code from this screencast on unitzeroone.com as a starting point.

Read more

Collision detection between particles and polygons

Thumbnail - Click me Click to run demo

A basic example of collision detection in 3D, where moving particles bounce off a static terrain.

A couple things on it which could be of use ...

Read more

Particle Field

Thumbnail - Click me Click to run demo

A matrix of vectors acting upon a field of particles. Reminiscent of falling water or snow, slightly. Click and drag to 'draw' vectors on the field to influence the movement of particles.

For me, the idea comes from Charles Forman's blog post in Setpixel from 2004, "Snow is fun".

SimpleFlvWriter.as - AS3 Class to Create FLV's

An Actionscript 3 class for use with Adobe AIR to create uncompressed Macromedia Flash Video (FLV) files to the local filesystem. It will add proper onMetaData info as well. It's very simple to use.

Example usage:

var myWriter:SimpleFlvWriter = SimpleFlvWriter.getInstance();
myWriter.createFile(myFile, 320,240, 30, 120);
myWriter.saveFrame( myBitmapData1 );
myWriter.saveFrame( myBitmapData2 );
myWriter.saveFrame( myBitmapData3 ); // ... etc.
myWriter.closeFile();

See the comment blocks in the source for more info. It doesn't support audio.

This comes out of the app I made a little while ago, Webcam DVR. I'm posting the class file now because the app is fresh in my mind, as I just updated it to make it compatible with the current AIR runtime to enter it into the Adobe AIR Developer Derby.

Seam Carving in AS3, with source

Thumbnail - Click me Click to run demo

Seam carving is a recently unveiled technique by Shai Avidan and Ariel Shamir to intelligently resize images (YouTube; white paper).

Like Hector Yee (whose writeup was very useful), I decided to try an implementation, but in Actionscript 3.

The attached demo only resizes images vertically, not horizontally. I wish I could have, but didn't bother including a dynamic image loader. It's also, well, very pokey, but the code is readable and the output seems accurate. If you can stand the wait, press [M] a few times to load up the seam calculation queue.

If you're interested in a more fully-realized online demo of seam carving, here's one that's been done in Java.

Update: Additionally, as it turns out, Patrick Swieskowski has already put up an online seam carving Flash demo here.