Ogre3D Collada Plugin

Introduction

Ogre3D (Object-Oriented Graphics Rendering Engine) is a leading open source 3D engine. COLLADA (COLLAborative Design Activity) is the XML based next generation open source 3D scene interchange format used by Sony for Playstation 3 development (and many more), which is supported by all major 3D vendors (Maya, 3DSMax, XSI, ...). With this plugin it should be possible to load collada xml files (*.dae) into your Ogre application.

Features

  • uses the Ogre::SceneManager of your application for attaching entities
  • imports only a part of the DAG collada scene graph or the full scene
  • available geometry types: triangles and polygons (last one would be triangulated simply)
  • uses Ogre triangle list with vertex buffer objects
  • materials with multipass support and textures
  • lights (ambient, directional, point and spot)
  • camera support (orthographic and perspective)

open (currently not implemented)

  • Ogre::ManualResourceLoader
  • update to Collada 1.4
  • animation
  • shader
  • skinning
  • and more ...

Documentation

Here a simple tutorial for using the plugin with your application.
  • first of all setup an Ogre application (maybe found on the Ogre wiki help sites)
  • prepare for requirements of the plugin (see README)
  • paste following code
#include "OgreColladaManager.h"
#include "OgreColladaScene.h"
...
    ColladaDocumentPtr daeDoc = ColladaManager::getSingleton().load("colladafile.dae", mSceneMgr);
    LogManager::getSingleton().logMessage("ColladaDocument - import started");
    if (!daeDoc.isNull())
    {
        // build up scene fully
        daeDoc->getScene()->createOgreInstance(NULL);

        /**
         * or
         * to import only a specific part of the scene graph
         * fetch the scene node by its unique node name
         *
         * ColladaSceneNode *box = mScene->getNode("Box2");
         * if (box != NULL) box->createOgreInstance(NULL);
         */
    }

    LogManager::getSingleton().logMessage("ColladaDocument - import finished");
    // Note: ColladaDocumentPtr is a shared pointer and will release the resource when it goes out of scope
...

First of all a new collada document has to be created, it takes an Ogre::SceneManager. Everything of this document would be attached to the given scenemanager, which could not be changed for the current document.

Now an import with the filename as argument could be started. The plugin loads the full document and saves some xml nodes for fast importing. See the ColladaLibraryContainer for further details. It holds all collada libraries, currently: CAMERA, GEOMETRY, IMAGE, LIGHT, MATERIAL and TEXTURE. Each library entity has a unique identifier.

Afterwards the SCENE would be parsed and a collada scenegraph is built up, by linking the nodes to their corresponding entities. The transformations and boundingboxes are imported too.

If import was successful, a ColladaSceneNode can be traversed to an Ogre instance. In addition to import the complete scenegraph only a specific node can be instanced too (see example above). Now all collada specific items are attached to the Ogre::SceneNode passed through createOgreInstance(). Above the example takes NULL, which means the root scenenode of the scenemanager. In fact an import of only one entity (CAMERA, GEOMETRY or LIGHT) is possible. By importing the whole scene the light(s) would be attached automatically to the scenemanager, the camera(s) too, but to activate a camera it has to be set manually.

For development and requirements please see the README file enclosed to the download packages. For source documentation with doxygen click here

For feature requests, bugs and more please contact philipp.hartl[at]bkf.at or discuss at the Ogre platform. See thread "The Ogre COLLADA plugin".

Screenshots

cubes mutltimtl Collada dae Nehe Cube
2 cubes material collada.dae textured

Downloads

latest version is 0.4, beta status

  • Source package: zip [Kb]
 
maintained by Philipp Hartl
last update on 2006/06/19
comments to philipp.hartl[at]bkf.at
Valid HTML 4.01 Strict Valid CSS!