[osg-submissions] some changes to osgdb_dae (Collada plugin)

Robert Osfield robert.osfield at gmail.com
Mon Sep 3 02:55:31 PDT 2007


Hi Mattias,

I'm just reviewing your changes and need to get a few things clarified
as I'm not sure the changes are always appropriate.  I'm not too
familiar with Collada so can't make quick decisions on it.

First up, collapsing COLLADA scale, translation, rotation node into a
single PositionAttitudeTransform certainly makes sense to me.

However, I am concerned that the code now assumes that a
PositionAttitudeTransform is required, and looks to me after a quick
scan with always use one even if there are not transform related nodes
in the COLLADA graph.  I would have expected a conditional use of
PositionAttitudeTransform.

Robert.

On 8/28/07, Mattias Linde <linde at acc.umu.se> wrote:
> Hello,
>
> We are using Collada and OpenSceneGraph and how the current plugin handles nodes makes
> the visual stuff hard to control.
>
>
> Collada is a xml-based file format for content exchange. In the files (named .dae) one can
> have <node> .. </node>.  These nodes can have zero or more rotate, scale and translate tags
> inside them. Nodes can also contain nodes.
>
>
> The node hierarchy returned from the plugin is deeper than it should be (and loading and saving the
> same scene a couple of time will make a real mess out of things).
>
> I'll give an example to show the problem (some xml remove to make it more readable):
>
> <node layer="L1" id="Cube" name="Cube">
>         <translate sid="translate">0.00000 0.00000 0.00000</translate>
>         <rotate sid="rotateZ">0 0 1 0.00000</rotate>
>         <rotate sid="rotateY">0 1 0 -0.00000</rotate>
>         <rotate sid="rotateX">1 0 0 0.00000</rotate>
>         <scale sid="scale">1.00000 1.00000 1.00000</scale>
>         (removed stuff)
> </node>
>
>
> This will be read in as: (name and node-types)
>
>    Cube (Group)
>       translate (PositionAttitudeTransform)
>          rotateZ (PositionAttitudeTransform)
>             rotateY (PositionAttitudeTransform)
>                rotateX (PositionAttitudeTransform)
>                   scale (PositionAttitudeTransform)
>                      Cube-Geometry (Group)
>                         Material (Geode)
>
>
> If one also wants to use the physics part of collada there can be rigid_body-tags which specify the
> position of a (visual) node. Now that the node rotation and translation are split into several different
> PositionAttitudeTransforms there are some problems updating the visual node so it has the same position and
> rotation as the rigid body. (there is also a comment in the code, "TODO: I am doing transforms wrong. ...")
>
>
> With the changes made to the plugin the example above would be read in as:
>
>    Cube (PositionAttitudeTransform)
>       Cube-Geometry (Group)
>          Material (Geode)
>
>
>
> I've attached the changes for review.
>
> The code have been tested with a some different collada files.
>
> / Mattias
>
>
>
> _______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
>


More information about the osg-submissions mailing list