Away3D Animated MD2 to AS3

Flash

fastbitmap

Broken link, file corrupted etc… we all have experienced those things…

In Away3D there is a native export to AS3, you can export any model loaded in your project to the AS3 format: .as. This allows you to compile the final version of your work in Flash without using the original model(s). Not only making the loading procedures easier, it also provides a better way to protect the 3D models from being reused once published.

Away3D supports MD2 natively too, and it was already possible to export MD2 like any other supported formats, but not yet possible to export the animation data to AS3. Until now !

The little demo shown here displays an .obj file (the flowers) and an animated MD2 model (the Hummingbird) converted to an AS3 class. The original models were needed just to set up the scale into scenery, then both files were exported as .as files and compiled with the rest of the code. This gives us a nice extra for free: colored declarations in our code eg. new Flower() or new Bird();. The concept “beauty of code” takes a new dimension! Soon some Flash code poetry contests?

I’ve also extended the export option to a fixed decimal count. If you take a look at 3D data, especially when the original model is being rescaled on screen, you often get numbers with more than 10 decimals for all vertex definitions… so one little boolean set allows you to save more than 50% of the .as class filesize (this was the case on the models displayed here). Depending of course on the amount of polygons, the more polygons, the more the ‘compression’ becomes obvious. At max fixed 4 decimals I couldn’t find any problems on renderings. If a particular case generates an ugly artifact, just don’t set the boolean!

Shown in this demo too, the latest version of the enviroMaterial code. Even smoother!Watch Full Movie Online Streaming Online and Download

This exporter will be release in the 2.0 version of Away3D.

BTW, take a peek at away3d.com on Rob’s latest work, it might not be that obvious, but trust me on this, that’s not only state of the art code, that’s an unseen in Flash! Well done Rob!