Friday, August 28, 2009

PureMVC Painter



View demo

View source

Whew...I just finished my very first PureMVC project. It's just a simple painter application, with standard pen, eraser, and clear functions, not appealing at all.

I've gone through PureMVC classes and documentations a couple of times, but never taken my time to actually try using it to build a complete application. Finally, I've put things together and create this little app. You can take a look in the source files if you're interested.

Stardust FlashDevelop Templates



Get Stardust FlashDevelop templates

Stardust project homepage

I've created a FlashDevleop template pack for Stardust. Now you can extend Stardust at ease without worrying about forgetting which methods to override. The templates include all abstract methods that need to be overridden for you.

Tuesday, August 25, 2009

Particle System XML Reconstruction Example



View manual (PDF)


I've added an XML Reconstruction example chapter after the Working with XML chapter. This chapter gives a brief example demonstrating how to reconstruct a Stardust particle system from XML data. And at the end it shows you the power of tweaking parameters of a particle system without recompilation, simply by modifying the external XML file.

Monday, August 24, 2009

Blizzard



View example

Stardust project homepage

Believe me, it looks much better in motion.

This example uses Perlin noise to create turbulence and a UniformField to pull particles toward the bottom left, preventing particles from being "blown" too far away from the intended direction by the turbulence. To add some flavor to the interactivity, I've also created a circle deflector following the mouse cursor.

Stars & Sprinkles



View example





View example

Stardust project homepage

I've ported these two basic examples from Emitter.
I think these effects are also very common.

The first one involves a SinglePoint zone following the mouse cursor, acting as the zone for the Position initializer.

The second example uses the Damping action to slow stars down, creating a damping effect.

Stardust Example: Drips



View example

Stardust project homepage

I saw this Flash & Math article, and tried to use Stardust to imitate the dripping & splashing effect :p

I though I could go back and make some simple Stardust examples unlike the recent fancy ones. After all, we all do need easy examples to help us get started, don't we? So here it is, a very simple drip-and-splash particle effect.

Sunday, August 23, 2009

Waypoints



View example

Stardust project homepage

I've added a new action: FollowWaypoints.

Used along with the Waypoint class, this action causes particles to follow waypoints in series, creating a path-finding behavior. There's also an option for whether particles loop back to the first waypoint after passing through the last waypoint. A 3D version is available as well: the FollowWaypoints3D class.

The algorithm used by the FollowWaypoints class was inspired by the Path Finding section in the Steering Behavior chapter of AdvancED ActionScript 3.0 Animation, by Keith Peters.

Saturday, August 22, 2009

Masked Collision & Turbulent Pixels



View example





View example

Stardust project homepage

Here are two more examples for Stardust.

The first one demonstrates the particle masking feature: each particle is assigned an integer mask, and two particles would only collide against each other if the bitwise-AND of their masks is non-zero. In this example, red particles are given a mask of (1 | 2 | 4), green ones 2, and blue ones 4. The result is that each particle collides with others of the same color; moreover, red particles also collide with particles of the other two colors. You can notice that a green particle does not collide with a blue particle, since the bitwise-AND of 2 and 4 is zero.

The second example shows the PixelRenderer class in action. This class renders pixels into a BitmapData object. The turbulence effect is created using Perlin noise along with a BitmapField object used as a gravity field.

Friday, August 21, 2009

ZedBox Carousel Effect with Depth-of-Field



Launch Site

ZedBox project homepage

Milkmidi at Medialand created this carousel effect using ZedBox, my 3D billboard engine.
He also used the BlurZFilter class to create a depth-of-field effect.

Using ZedBox, to create this carousel effect simply involves placing objects into a parent container, and tweaking the parent container's rotationY property.

Tuesday, August 18, 2009

Pixel Star Fireworks



View example

Stardust project homepage

I've added a Color initializer and PixelRenderer renderer.
As the renderer's class name suggests, it draws pixels into a BitmapData object.
This example was inspired by this Flint example.

Monday, August 17, 2009

Stardust Class Inheritance Diagram for Kids



View diagram


That's it. I've had enough of UML class diagrams.
They look professiona, but are visually...uh...tasteless.
So I decided to create class diagrams of my own style for the Stardust manual.
This is the class inheritance diagram in the manual.

Sunday, August 16, 2009

Stardust Manual



View manual (PDF)


Behold! It's the Stardust manual!
Although it's still not complete, it has already covered the features and class responsibilites of the engine.
And it also includes a minimalistic example at the end. I'm sure this will help understand the basic usage and workflow of Stardust.

Thursday, August 13, 2009

Stardust Particle Engine Goes Beta




Project homepage


Yes, Stardust goest beta!
There are already a bunch of examples to watch, source files provided.
Check them out on the project homepage or download them directly.
I've also added a very abstract class diagram.
I'll make more diagrams and tutorials to help you understand and use Stardust :)

Here's the class diagram.



View Stardust class diagram

Tuesday, August 11, 2009

Pink Triangles



View example

Stardust project homepage

This is a test for the CalculateScreenVelocity BillboardOriented actions for Stardust 3D (the Stardust native 3D engine). The CalculateScreenVelocity action projects a particle's velocity vector in 3D space onto the screen, yielding a 2D vector. The BillboardOriented action then align 2D display objects' rotation values to these 2D vectors.
You can pause the example by pressing the "Pause" button at the bottom left. The simulation will stop, but the particles will still align to their projected 2D velocities as you rotate the camera.

The source files for this example can be found here.

Monday, August 10, 2009

Stardust Sakura 3D



View example

Stardust project homepage

After the Sakura examples for ZContainer and Emitter, this is the third generation of Sakura example, for Stardust! It's seems that Sakura demo is a must for all my engines now.
I didn't use the ZedBox, Papervision3D, or ND3D extension. Stardust has a native 3D rendering engine.

You can press the "Pause" button at the bottom left to pause the petals, and rotate around the camera to look around. Enjoy the bullet time :p

The source files for this example can be found here.

Sunday, August 9, 2009

Exploding Image



View example

Stardust project homepage

Looks familiar? Yes, it's imitating this example from Flint Paritcle System.
The only difference is that Flint uses a static method defined in the Particle2DUtils class to create particles from a bitmap, and Stardust uses the BitmapBurster class, a subclass of Burster, to do the same thing.

The source files for this example can be found here.

Uniburst Is Back in Stardust!



View example

Stardust project homepage

As a left-out feature from the upgrade of Emitter 1.0 to 2.0, Uniburst is back in Stardust!
Now there's a Burster class whose sole responsibility is to allow user to create custom particles with full control over the particle properties, which means you can create particles that shows randomness (which is pretty much what Stardust is doing) or particles whose properties conform to a regular, uniform pattern. The latter is what Burster is mainly meant for. So far there's only one subclass, the PointUniburster class. It works just like the uniburst() method of the PointSource in Emitter 1.0: it bursts out particles spreading out at uniformly distributed angles. I'll make more Burster subclasses in the future.

The source files for the example can be found here.

Saturday, August 8, 2009

Stardust Example Screenshot Wall



Right on! This "wall of examples" sure looks attractive, doesn't it? And I'll add more tiles to it!
Things to do: complete documentation and official tutorial website.

Two More Stardust Examples



View example





View example


One of the best features of Stardust is the Spawn action (and yes, there's a 3D version, I'll make an example of it as soon as possible), and I made a fireworks example out of it.

Also, the ZedBox extension is now complete, so I made use of the BlurZFilter provided by ZedBox to create the depth-of-field example.
If you are using a debug Flash Player, you'll notice that there're some errors being thrown, something concerning FocusManager class in the fl.* package. This happens when you use Flash UI components with ZedBox. I have no idea how this happens, but you can simply ignore the error since it has no impact on the Flash movie.

The source files for these examples can be found here.

Friday, August 7, 2009

Stardust Documentation



View Documentation


Finally, the first documentation of Stardust has come out. Although it's not fully documented, it's there, and you can still browse the available classes, proeprties, and methods much easier than directly staring at AS source files. Whew, there are in total 214 classes so far - the biggest project I've ever done.

I'd had some problems dealing with ASDoc. The "-doc-sources" and "-exclude-dependencies" options cannot be used together, which means I had two options: either including all related classes in the documentation (ZedBox, Papervision3D, and ND3D), or using the "-exclude-classes" option to filter out classes ONE BY ONE (there are hundreds of unwanted classes). Fortunately, later on I discovered that using compiled SWC libraries as sources, the classes in the SWCs would not be included in the final documentation by ASDoc. ZedBox and Papervision3D already had compiled SWCs provided, so I compiled the SWC file for ND3D my self using the compc.exe compiler shipping within Flex SDK.

After hours of struggle, I've finally got everything right and here's the documentation. Enjoy :)

Turbulent Blast



View example


After some experiment with the BitmapField class, I made this turbulent fiery thing. It looks cool, and the performance seems to be pretty decent.

The source files for this example can be found here.

Text Spark



View Example


GMG (sorry I don't know your real name) asked me if it's possible to use Stardust to create effects like this.

The answer is yes.
Now Stardust supports fields and zones based on bitmaps, so you can make particles spawn at positions corresponding to non-transparent areas of a bitmap.

The source files for this example can be found here.

Thursday, August 6, 2009

Bitmap Turbulence



View example


Inspired by the algorithm from ClockMaker's work, I tried to replicate the same effect with Stardust, and this is what turned out. The main idea is very simple: prerendering 360 pieces of bitmap data of a display object rotated at 0~359 degrees. All the visible particles are Bitmap objects, and they change their bitmap data according to their rotation values, each picking up a bitmap data from the 360 prerendered ones.

Simple, but produces much better performance than using vector graphics alone.

The source files for this example can be found here.

Tuesday, August 4, 2009

Stardust ND3D Extension



ND3D Official Homepage


Yesterday I mailed Lars, the author of the light-weight 3D engine, ND3D, asking him if it's okay to include an ND3D extension in Stardust, and he agreed. Hence, now I'm working on the ND3D extemsion for Stardst. As soon as I finish all of the four Stardust 3D extensions - Stardst native 3D, ZedBox, Papervision3D, and ND3D - I'll move on to create more demos and examples.

Stardust is near its completion. Cheers!

P.S. I'm also under the pressure of the upcoming PTT Flash forum workshop this month. I said I would demonstrate Stardust in the workshop (the COMPLETE Stardust of course) and I WILL do what I promised.
(PTT is the biggest BBS site in Taiwan)