Robert,

Thanks for the help.

The nodes I am replacing are indeed derived from osg::Transform, but I
am having difficulty figuring out how to implement your advice.

I am working on a program that allows users to import and
move/rotate/scale objects from .osg files.  Right now, all of these
objects are imported with a transformation matrix that puts them in
the same starting location.

I have two questions.  First, how do I just retrieve the node from the
.osg file?  I tried just selecting the node I wanted to replace, then
choosing the .osg file that contained the node I wanted to replace it
with.  The scenegraph does not change at all when I do this.  I
checked the documentation for osg::Transform, Group, and Node and am
not seeing an appropriate "get node" function.

Second, if I do just replace one node for another node, won't the
object still show up in the wrong place because the new object's
transformation matrix (that puts it in the correct starting position)
will not be applied?  If so, how would I get around this?

Thanks again,
Catherine Peloquin

----
Message: 5
Date: Fri, 22 Jun 2007 16:44:24 -0500
From: Robert Penn Taylor <[EMAIL PROTECTED]>
Subject: Re: [osg-users] Maintaining transformation matrix changes
      when using      replaceChild
To: osg users <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


If the node you're replacing is derived from osg::Transform, that's
probably your problem -- get the Group/Geode/whatever under that
transform and replace that stuff while leaving the Transform intact.

--

Robert Penn Taylor
Graduate Research Assistant
Department of Mechanical Engineering
Iowa State University

Catherine Peloquin wrote:
I am using replaceChild to replace nodes, but the new child node does
not reflect any changes in position that were made to the replaced
child node.

Is there another way to have the new child be placed in exactly the
same position as the old child?

The only way I can think to do this is to apply the transformation
matrix of the old child to the new child, but I do not know how to
retrieve the old matrix or to actually apply it to the new matrix.

Thanks,
Catherine Peloquin
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to