Hello!
Thanks for the explanation; when I remember my introductive computer
graphics lectures correctly, OpenGL itself does operate on per-vertex basis
only when it applies transformation matrices, so the example given below
needs no further comments.
Now I go slightly "off-topic", since this question isn't 100% OSG-specific,
but I can't imagine I'm the only one having such problems when integrating
OpenSceneGraph with other software components like a physics engine...
But then, let me rephrase my question: How can I correct the "offset"
between a body's local coordinate origin that OpenSceneGraph uses, and the
local coordinate origin that Bullet uses respectively? I found a post by you
in the Bullet forums that mentions a similar operation, but is concerning
another issue (shifting the center of mass of a body):
http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2209&hilit=center+of+mass
The problem I'm facing is that both OpenSceneGraph and Bullet show the SAME
set of coordinates for a local coordinate system's origin of a geometry
imported from a COLLADA document:
- For OSG: This is obtained from getAttitude() and getPosition() of the
PositionAttitudeTransform node that contains the subtree in the scene graph
which holds the geometry.
- For Bullet: Obtained from getWorldTransform().
Now, since both coordinate sets apparently are equal, and since I don't know
the actual offset between OSG and Bullet coordinate systems: How can I get
both coordinate systems to coincide? Is there a way to achieve that at all?
Thank you very much!
With best regards,
Fabian Aichele
----- Original Message -----
From: "Paul Martz" <[email protected]>
To: "'OpenSceneGraph Users'" <[email protected]>
Sent: Friday, January 16, 2009 6:34 PM
Subject: Re: [osg-users] Choice of body-specific coordinate system
originbydae(COLLADA) reader
How exactly does OpenSceneGraph decide to place the origin of a
geometry-specific (i.e. local) coordinate system?
OSG does not decide this. It depends on how the geometry is specified.
Imagine a unit cube with corners at (-.5,-.5,-.5) and (.5,.5,.5). OSG
draws
it with its center at the origin. Now imagine another unit cube, but with
corners at (20,14.6,-32) and (21,15.6,-31). Its origin is still (0,0,0),
but
OSG draws it several units away from the origin because of the way it was
"modeled".
(And of course you can change the position of either of those cubes by
using
a Transform node such as MatrixTransform.)
If this information seems unfamiliar to you, I would strongly encourage
you
to purchase and read through some introduction to 3D graphics books before
you proceed with your work. It's important to have a firm grasp of
coordinate spaces.
-Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org