[ODE] Object hierarchies

Doron Tal dtal at email.arc.nasa.gov
Wed Mar 29 20:03:31 MST 2006


I've been doing similar tree-like stuff for years,
and what I use may help: ODE + Open Inventor
(which replaces the combination of ODE + drawstuff).
Open Inventor will do all the parent/child automatic
transformation stuff for you, it's easy to use, super well
written (whether you use the original SGI code or the
Coin3d open-source version) and the native format of
the objects is VRML so there are a million converters
from/to any other 3D format.  There are many other
scene-graph packages that can do the same, by the
way, e.g, open-scene-graph.

Jean-Sebastien Guay wrote:
> Hello,
> I am making a program where the meshes I load are in a hierarchy. More
> specifically, every object looks like this:
> --- Root (no geometry)
>  |--- child1 (geometry)
>  |--- child2 (geometry)
>    |--- child2.1 (geometry)
>  |--- child3 (geometry)
> etc.
> There could be any number of children to any node, including the root. Also,
> some objects need to be mobile, others not.
> I am trying to find the best way to represent this in ODE. I have read the
> User's Guide and there are two recommendations that apply: immobile objects
> should have no rigid body object, only a geom, and I can represent a hierarchy
> of objects with geomTransforms.
> So for now, here's what I have:
> - The root has no geom and only has a body if the object needs to be mobile.
> - Sub-objects have a geom and a geomTransform linked to the geom. If the main
>   object is mobile, the geomTransform is linked to the root's body. (which means
>   that there are multiple geoms linked to one body - is that OK?)
> What I'm having trouble with is transformations. Is there a way to link
> geomTransforms to something even if the object needs to be immobile? It seems
> like that would simplify things a lot, since then in all cases I could just
> move the root node's object and all the children would follow. If not, would
> the right way of doing it be that I move all the geomTransforms from the root
> down by the same amount if I need to move an immobile object?
> (I know "moving an immobile object" is a contradiction, but I need to place the
> objects in the world somehow...)
> Most of this is implemented, but I'm having problems with collision detection
> (as my past messages have shown) and I thought I might need to see if the basic
> ideas in what I'm doing are right. I really have a feeling that sub-objects are
> not where I think they are in the world, which would be why two objects do not
> collide when I think they should.
> In general, am I approaching this the right way? Has anyone done something
> similar in the past? I thought of merging all the sub-objects into a single
> object by just appending the vertex and triangle lists together, but that would
> probably be more work than necessary and I would have to special-case it when
> some parts of an object need to move independently from the rest.
> And in case anyone asks, I can't change the way the object hierarchy is
> constructed. We have an exporter that exports objects from 3D Studio Max, and
> that's how it exports them...
> Thanks in advance,
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay     jean-sebastien.guay at polymtl.ca
>                          http://whitestar02.webhop.org
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode

More information about the ODE mailing list