Monday, September 7, 2009

Particle Snapshot Restoration

View example

Stardust project homepage

Click anywhere in the demo to explode particles, and click the "Restore Image" button to see the magic of snapshot restoration!

I mentioned this "snapshot" restoration stuff on my previous blog post.
This feature is now complete. You can grab it from the SVN repository.

The logics behind are pretty simple: the Snapshot class stores particle states (i.e. "snapshots") using an internal VO (value object) class, SnapshotData, and the SnapshotRestore class simply uses the easing equations to tween particles back to the previous taken snapshots.

I've also provided a ParticleRestoreFlag class for you to specify whether you want to restore the positions, rotations, scales, or more than one of these properties of the particles.


sander said...

Stardust looks very promising! Unfortunately, none of your examples (basics & applications) work within Flash CS4. (your compiled swf's do work).
If I test e.g. CircleSource.fla, I receive the error

VerifyError: Error #1014: Class idv.cjcat.emitter::Emitter could not be found.
at global$init()

What do I do wrong? The folder idv is in the same folder as the fla-file...

CJ Cat said...

I suggest that you place the idv folder in another place, rather than the same directory as the FLA file, and then add that folder to the class path.

This should work.
I can compile my examples in both Flash CS3 and CS4.