Close Show/hide page

Archive for April, 2007

Fun with Transparent Windows in Apollo

Friday, April 27th, 2007

Action shot at work- Ryan and Al :P

As I’ve been updating Flash Webcam DVR to Apollo, I came up with a kind-of amusing idea of overlaying alpha images from a webcam across the desktop area. The key was plugging in the right magic numbers into the ColorMatrixFilter class (See source code below). While running the program, click on the image to toggle filters.

Download (requires Apollo runtime, webcam)

- Source code for main class file
- All project files

Version: 0.9

Licensed under a Creative Commons Attribution 3.0 License.

3D Page Curl Effect - Updated

Sunday, April 22nd, 2007

Thumbnail - Click meA few improvements have been made enhancing visual quality as well as overall framerate under load, plus a few presentation and interface-related tweaks.

The main class file for the effect has been updated as well.

Thanks to Carlos Ulloa and Alexander Zadorozhny for their thoughts on the Papervision3D mailing list.

3D Page Curl Effect using Papervision3D

Thursday, April 19th, 2007
Thumbnail - Click me
The venerable Flash effect of turning a page in a book done in 3D. I originally designed and programmed this effect in Actionscript 2 using a home-grown 3D class library at about the time Papervision was entering public beta. This implementation using Papervision3D and AS3 runs a few times faster.

Press ENTER to create new instances of the book. Press it several more times and watch your browser chug :).

Here’s the main class for the page turn effect. I used the code for the PV3D Plane class as a starting point (but, in hindsight, probably should have subclass’ed from it instead). To create the appearance of a rotation of the 3D object, the individual vertices are rotated around the Y axis by increasing amounts depending on their (original) position along the X axis.

Version: 0.9B - Last updated on 4/22/2007

Licensed under a Creative Commons Attribution 3.0 License.

Bitmap Pixel Dissolve

Saturday, April 7th, 2007

Thumbnail - Click meAn image fade/dissolve where the individual pixels move off the bitmap and disappear. Written a couple months ago to learn how to get around in AS3. Not to be confused with the built-in BitmapData.pixelDissolve method.

In the supplied AS3 class, the direction of the movement of pixels is ‘hard coded’ to go from right to left. (Here’s the full project, as well.) To move the pixels in the opposite direction or up and down, the bitmap is rotated 90, 180, or 270 degrees and the wrapper sprite is rotated equally in the opposite direction - which is possible to interpret as a kludge.

To-do: Change the method used to select pixels that are to be animated. The way it’s done now is inefficient. If you look at the code, you’ll see what I mean. Again, if anyone wants to post any changes to the class that improves performance, please do.

Some other possible to-do’s: Dissolve images in an arbitrary direction; allow pixels to trail beyond the current boundaries of the bitmap; allow for the changing of parameter variables’ values while the effect is in progress; support for transparency.

Eating away individual pixels of a bitmap similar to what’s done here, it seems to me, could be the basis for some fun retro gameplay mechanics for a Flash-based game, à la Lemmings or Worms.

Version: 0.9

Licensed under a Creative Commons Attribution 3.0 License.

Actionscript Halftone Effect

Friday, April 6th, 2007


Some of the most satisfying graphics effects are simple in concept and execution. Like programmatically creating a half tone-style image from a bitmap, as it turns out (as seen in the blog masthead). I got this right essentially on my first try.

Here’s the class in Actionscript 3. It’s esssentially one public method which takes in a bitmap and writes to a sprite. With a few optional parameters. See the source code comment block for the details. I believe it’s pretty well optimized, but would love to see any improvements made to it for speed.

To do: Add the ability to use overlapping colors. Apparently, the dot patterns for additional colors are supposed to be set at different angles from each other — which is less straight-forward, programmatically speaking, than simply setting the ’screen angle’ to 45-degrees, as I’ve done here. Please post any good ideas or improvements to the code below.

Version: 0.9

Licensed under a Creative Commons Attribution 3.0 License.

Flash Webcam DVR

Friday, April 6th, 2007

Thumbnail - Click me

I recently spent a couple weekends geeking out to make this. It’s pure Actionscript 3, which meant excessive amounts of code to draw the UI.

You’ll need a webcam to test this.

Big caveat: This eats up a _ton_ of memory, as the video is simply made up of hundreds of frames stored in an array of BitmapData. Bigger caveat: The save and load feature is only practical for very short video clips, and will otherwise bring down the browser (!). It stores megs of data to a local SharedObject, which surely constitutes a criminal abuse of what LSO’s are designed to do. Hah. Rational: When doing personal stuff, I’m only half-interested in questions of usability and stability (Did I just say that?! LOL.)

To-do, hopefully: Port to Apollo. (But first learn how to use Apollo, haha). Offload video data from memory to disk using the Apollo file I/O API (Thanks, Béla, for the idea).

To-do, ideally: Find a solution to compress video to memory/disk on the fly.

Version: 0.8