Close Show/hide page

Archive for the ‘flash’ Category

Testing Kinematics with Papervision3D, Collada

Wednesday, January 30th, 2008
Thumbnail - Click me

A forward kinematics experiment using Papervision3D v2.0 alpha and a Collada 3D model of a robotic arm.

Hope you enjoy it.

I don’t want to release any source from this yet, as I want to do some more work on it, relating to the following items…

(more…)

A Papervision 2.0 alpha example

Monday, January 7th, 2008
Thumbnail - Click me

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.

The source code has example usage of the following things…

(more…)

Collision detection between particles and polygons

Saturday, January 5th, 2008
Thumbnail - Click me

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 …

(more…)

Particle Field

Monday, September 24th, 2007
Thumbnail - Click me

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.” Which is incredibly great. And done in Processing.

Source code:

- Actionscript 3 class

- Full project (Flash 9/AS3)

Licensed under a Creative Commons Attribution 3.0 License.

SimpleFlvWriter.as – AS3 Class to Create FLV’s

Saturday, September 8th, 2007

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.

Download Webcam DVR for AIR, updated for the beta AIR runtime (See the previous Webcam DVR post for usage notes).

Licensed under a Creative Commons Attribution 3.0 License.

Seam Carving in AS3, with source

Sunday, September 2nd, 2007
Thumbnail - Click me

Seam carving — the recently unveiled technique by Shai Avidan and Ariel Shamir to intelligently resize images (YouTube; white paper) — really captured my imagination when I came across it last night, as it has for many others.

Like Hector Yee (whose writeup was very useful), I decided to try my hand at an implementation of it just for the hell of it, 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.

But the most valuable thing about this demo is its publicly available source code under a Creative Commons license:

Static utility class | App class | Project ZIP file

So if you’re so inclined, please improve, extend, optimize, and/or port this code. I’m not planning on doing any further work on it. Just let me know if you find the code useful, and share your work.

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.

Version: 0.8

Licensed under a Creative Commons Attribution 3.0 License.

Online portfolio

Monday, August 27th, 2007
Thumbnail - Click me
After two failed attempts in the last year or so, I’ve finally done up a Flash-based online portfolio page that I’m willing to call finished. For better or worse, I decided to use the guts of the 3D sine wave demo as a visual centerpiece for it.

One point of interest is that while the thumbnail images are preloading and the progress bar is up, it’s actually measuring the framerate of the 3D animation in the background, and then based on the results, adjusts the detail level of the plane accordingly.

3D Sine Wave Study w/ Papervision3D

Monday, August 13th, 2007
Thumbnail - Click me

A wavey liquid surface being hit by rocks.

For best performance, you’ll want to use the 9.0.60 version of Flash Player with a multi-core CPU. Press D to lower the level of detail if it’s killing your browser.

Other controls:

T cycles through different textures
B cycles through texture blend modes
W shows the 3D wireframe
+/- moves the camera in and out
Spacebar pauses the action, allowing you to rotate around the scene

Conceptually, here’s whats going on…

(more…)

Particle Motion Study

Wednesday, June 20th, 2007
Thumbnail - Click me
A motion study using a simple “particle system” to create organic, flowing movement suggestive of tadpoles or sper|m. Particles gravitate towards each other based on mass and proximity.

Possible to-do’s could include adding… optimization (!); three dimensions; obstacles; collision detection; repulsion in addition to attraction; ‘environmental’ effects like wind or current; rules to govern particle life cycle…

 

Webcam Digital Video Recorder for Apollo

Wednesday, May 16th, 2007
Thumbnail
I’m pleased to announce the first public release of Webcam Digital Video Recorder for Apollo, which lets you record webcam video to the local file system while simultaneously playing back video from the same file (timeshifting). Unlike its browser-bound predecessor, this Apollo port does not rely on system memory to store video, but instead uses the Apollo File API to asynchronously save and load video on the fly, and can also convert its video to Macromedia Flash Video (FLV) format.

Download (requires Apollo AIR runtime, webcam)

* Updated for compatibility with the Adobe AIR runtime 1.0, 4/9/2008 *

(more…)