Techblog

Tech Blog

Our latest geek adventures!

14 August Introducing ASCOLLADA

I’m happy to introduce ascollada, a AS3 library for reading Collada files.

The library is geared towards Papervision3D but should work with any 3D-engine like Away3D or Sandy.

The library currently features:

  1. simple models
  2. material loading (watch your paths!)
  3. biped animation

Please note that the library is still in its very early stages and most likely will contain bugs.

So, get the code and try it out! And… please report bugs!

You can get the code using SVN:

http://ascollada.googlecode.com/svn/trunk/as3/trunk/

Papervision3D users can opt to use the ascollada branch of PV3D’s svn:

http://papervision3d.googlecode.com/svn/trunk/branches/ascollada/

There are some examples in the examples directory to get you going.

USAGE: for Papervision3D

// the DAE object is like papervision3d’s Collada object…
import org.papervision3d.objects.DAE;

var dae:DAE = new DAE( “somedae.dae” );

dae.addEventListener( Event.COMPLETE, daeCompleteHandler);

scene.addChild( dae );

You can also pass a MaterialsList to the DAE constructor to override materials defined within the file:

var materials:MaterialsList = new MaterialsList();

// create a simple wireframe material
var material:MaterialObject3D = new WireFrameMaterial();

// add to the list, use the materialname as specified
// in the Collada file.
materials.addMaterial( material, “Default” );

var dae:DAE = new DAE( “somedae.dae”, materials );

scene.addChild( dae );

6 Responses to “Introducing ASCOLLADA”

  1. Rafeo Says:

    Oohh! I just discovered. Does it works better than the Md2 class (in PaperQuake). I’m interested in importing 3d animation. Thanks ;) .

  2. Tim K Says:

    Animation is still bit bugged, but if you’re lucky it just might work :)

  3. masta Says:

    How do we use in Flash CS3? (not with Flex.)
    there is no “import mx.utils.StringUtil;”…

  4. Tim K Says:

    I’m in the progress of updating the code so it will not use mx.utils.StringUtil.
    Until then:
    a] use Flex (its free!)
    b] adapt the class using mx.utils.StringUtil and create your own String ‘trim’ code.

  5. Kalani Says:

    I got past the StringUtil problem by downloading the Flex 2 SDK. I still refuse to use Flex. Still have a bunch of other issues with package pathing…the flex compiler seems to know that import yadayada.* means import lower packages as well. Either that or the codebase for papervision has changed significantly so that things like core.Matrix3D are now in core.math.Matrix3D causing all sorts of errors throughout the app.

    Still writing my way through them by adding the packages in imports.

    By the way, thanks for ascollada!

  6. Tim Says:

    Hi,

    ASCollada is now part of Papervision3D’s Great White branch : http://papervision3d.googlecode.com/svn/trunk/branches/GreatWhite/

    I’ll be updating ascollada’s as soon as possible.
    In meantime please use Great White.

Leave a Reply