[osg-users] About Changing Parental Nodes?

David Spilling david.spilling at gmail.com
Thu Jul 24 01:56:07 PDT 2008


If I understand your problem correctly, the general approach would be to
compute the coordinate system matrix local to a group prior to a move (with
computeWorldToLocal) - call it A - then to move the node, recompute the
coordinate system in the new location - call this B - and apply the correct
matrix - i.e. inverse(B) * A -  to the immediate parent transform to get the
correct positioning. In this way, when moving the object around in the
scenegraph, it won't move in the world frame.

In this case, the yaw group doesn't have a parent transform, so the initial
matrix is the identity. The destination matrix will be the transform of
planetary's MatrixTransform node, so you will need to apply the inverse of
this matrix to your yaw specific MatrixTransform.

I can't help but think that you must be able to persuade your 3DS model to
be in a much more useful structure - all this programmatic model hacking
(although useful for understanding OSG) seems quite clumsy...

Regards,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080724/03a54a88/attachment-0003.htm>


More information about the osg-users mailing list