Fabian Aichele wrote:
Hello, osg-users!
I have a question regarding the choice of the body-specific coordinate
system made by the COLLADA reader (daeReader/Writer in osgDB).
When I import a geometry from a COLLADA document, the osgDB plugin
returns a osg::Group that contains the "nodes" declared in the COLLADA
document together with all the "geometries" used by the node
declaration, plus material properties etc.
That works fine, but there is one thing I haven't figured out yet: How
does the COLLADA importer decide where to put the "local" origin for a
node hierarchy imported from COLLADA? I have tested different
geometries consisting of 20 to about 50 triangle strips/fans/arrays,
but the body-specific coordinate system was chosen quite arbitrarily
(at least I couldn't figure out any pattern).
This is important for me to know since I use OpenSceneGraph to
visualize a rigid body simulation with the Bullet Physics engine, and
I haven't managed to get the OSG and Bullet coordinate systems "in sync".
Any hints or pointers to documentation/examples/earlier questions
regarding this are gladly accepted.
I don't believe the importer decides anything. All of this information
is in the file itself. The root of the document's visual scene is
placed at 0, 0, 0, and everything else is relative from there, according
to whatever transforms are attached to the visual scene's nodes. If
you're seeing an arbitrary origin, it's probably because it was modeled
that way (some of the COLLADA test models do have strange origins).
The only other influence on the coordinate system comes from the
document's <up_axis> setting in the global <asset> tag. This describes
whether the document's contents are X_UP, Y_UP, or Z_UP. This is used
to adjust to the OSG coordinate system (which is Z_UP).
Hope this helps...
--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org