Flash Player 10 - 3D rendering in a simple loop (source)

3D rendering in native fp10

I have been very busy playing with the latest features presented in the beta codenamed “Astro” of the next version of the Flash Player. Benoit and I were curious to know what it would look like to render some 3D objects without using a full library like Papervision and using only the new core classes included in the player, namely : PerspectiveProjection, Vector3D and Matrix3D.

Using only these and obviously the new additions to the Graphics API, especially the drawTriangles() set of methods, we were able to create a small example of one of our dynamic parametric shapes (the Kidney) and render it in 3D with rotations. All this without a full 3D library! Pretty nice to see alot of stuff has been pushed in the core of the player!

The new Vector array seems really nice, though there’s been some people discussing that there wasn’t a significant performance boost from using them since the generics used with them (the <>) would be applied at runtime. Haven’t had the time to verify that… I’ll just go ahead, close my eyes and believe :)

We’re working at pushing this demo in PixelBender space to see how it performs with some basic shading operations, but up to now it looks very promising! Benoit and I often meet next to the coffee machine dreaming of writing our own baby 3D engine written with astro’s new functionnality…why not I say! Kudos to Adobe!

Launch the Kidney Astro SWF

Peek at the full file right here and now for a wider view or grab the full source while it’s hot!

* Obviously, you need the fp10 beta to view the SWF =)

Papervision3D: Quad layer - Shape morphing source


Revisiting our Dynamic shape morphing work, I finally got time to clean up the source and have it ready for release. Sorry it took so long! I also parametrized the shape morph, allowing you to choose a more “bouncy” or “elastic” look :) (*cough*feature creep*cough*)

The first element in the source package contains the Quad geometry layer, allowing you to create geometry as Quads instead of triangles. (It actually still is 2 triangles!) The quad geometry class already has methods to add/remove quads to the geometry as well as fun “draw” and “morph” methods to go from one geometry to another.

Also available is our first shape pack. All the 3D shapes we ported from Paul Bourke’s list are available in this pack and can be used as you please in your own projects. Obviously, these 3D objects are using quad geometry. We’ve ported many more shapes for fun; we’ll most likely release another shape pack in the coming weeks.

Here’s the current list of shapes in the pack:
- Apple
- Astroidale
- Cassini
- Corne
- EllipticTorus
- HandkerchiefSurface
- Heart
- JetSurface
- KidneySurface
- KleinBottle
- KleinBottle2
- LimpetThorus
- ScherckSurface
- Pillow
- ShellNut
- SpringShape
- TriaxialHexatorus
- TearDrop

We did not include static DisplayObject3D shapes to go with all of those shape geometry, so in order to use one of those in your project you will need to do as follows:

Here’s a small snippet on how you would go about morphing between 2 objects:

These sources should be compatible with Papervision3D GreatWhite and Effects.

The source to the actually Flex application in the demo is also up for grabs in that package demonstrating many of the features of this small quad kit.

I hope this proves useful to someone, and if so, let me know!

Download the full meshMorph source (Flex app, Textures, Quad classes and Shapes)
or
Download turbulent_shapes1 (Quad classes and shapes only)

enjoy!

Flash CS3 Bug on Mac OS X and subversion (.svn files)

Flash IDE bug with .svn files

While developping our latest project we encountered a bug in the Flash IDE that caused us many headaches and woes. Our project was setup in the Flash IDE with assets and files located in subdirectories, nothing fancy. Right on the last day of production, suddenly after a particular commit , our project would no longer compile. Flash would return the standard compiler error: “A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export.” The document class is in the same directory as the FLA! What in god’s name is going on!

It turns out Flash is not able find any classes in the project’s directory. Even when creating a new FLA file with a classpath entry to the project’s directory ; the compiler would just refuse to find ANY classes in that particular directory.

After about a day of investigation, we isolated the problem to OSX, as PC checked out working copies of the project would function properly. We also found out that by doing a subversion “EXPORT” of the project (basically removing the .svn files from the project dir) the project would magically start working again.

After another day of headaches and stress we finally figured it out. It seems that under OSX *ONLY*, if you have a directory in your classpath that is under subversion control (has .svn files) and that any one single directory has over 128 files subversionned, it will make the flash compiler class lookup fail silently and stop. You’ll get the usual compiler error messages for unfound classes.

The solution?

Make sure that no single directory in your project has over 128 files in it under subversion control. If you have one, simply segment it into sub directories and commit.

Simple, tested and true.

I hope this saves some problems to others, I’m sure releaved I found it.

-b

What do Papervision, Coffee, old pens, duct tape and post-its have in common?

Ben's desk lately

I don’t like to blog off topic, but this was worth sharing.

Reference between reality and the code! Keeping it real !

Adobe, MAKE SOME NOISE…sound spectrum with 8bitboy!


Adobe, MAKE SOME NOISE

André Michelle, Joa Ebert, Kai-Philipp Schöllmann have a campaign in the run to motivate the marketing people at Adobe to include advanced sound manipulation in the Flash player. This is a cause I fully support and I really wish some of the issues raised by the campaign get resolved quickly!

Flash deserves a decent audio platform!

While I had my plasma code open, I decided to write a little sound spectrum effect while running old school MOD files through popforge’s amazing 8bitboy application. Hopefully, this can even help promote the cause!


Adobe MAKE SOME NOISE

The filter is vaguely the same as the plasma effect, but I split the left channel sound spectrum into low,mid, and high, and use those to modulate the color matrix.

Once again, here’s the meat:

CLICK to launch 8bitboy with Agit8 spectrum!

GRAB the source. (Obviously, you’ll need the source to 8bitboy as well from popforge.)

CLICK to visit and support them!

Flash oldschool filters : easy plasma effect and source!

Easy Plasma Filter

What do you know, sometimes, you get lucky! I was preparing a demonstration on how to use papervision’s effects renderLayers, and while playing with some filters, I stumbled upon this beautiful and very elegant way to create a Plasma Effect. One ColorMatrixFilter, a simple blur and a color transform make this little beauty tick. I guess accidents can sometimes be rewarding!

The effect is so simple it’s almost a crime! Here’s an excerpt of the meat of the filter:

Click the above image to see the plasma in action. 3 sliders to change 3 different parameters of the plasmer! I spent alot of time just marveling at how simple and fast the effect is. The best part is also that it’s 100% filter based, so it’s blazingly fast and won’t cost much on the CPU front.

What do you guys think?

LAUNCH the plasmer.
DOWNLOAD the source.