<div dir="ltr">Hi Dan,<div>I think your expectations are off. pose2 gets the postition from the node2 matrix, not the world postition.</div><div>to retrieve the world position you need to have a nodepath, so you can call osg::computeLocalToWorld( fullNodePath );</div><div>In your case this might be just the product for the node1 matix and node2 matrix.</div><div>Laurens.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019 at 10:26 AM Dan johansson <<a href="mailto:johansson_dan@hotmail.com">johansson_dan@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I've ran into a seemingly easy problem that i have failed to find an answer for. I've simplified the problem here to quickly describe my question. I'm setting a Pat node as parent to another Pat node and re positioning it. The updated position is not translated to the child and i wonder why this behavior occurs. Any help on the issue is welcome.<br>
<br>
<br>
<br>
<br>
<br>
<br>
Code:<br>
<br>
<br>
osg::ref_ptr<osg::PositionAttitudeTransform> node1 = new osg::PositionAttitudeTransform;<br>
osg::ref_ptr<osg::PositionAttitudeTransform> node2 = new osg::PositionAttitudeTransform;<br>
<br>
node1->setDataVariance(osg::Object::DYNAMIC);<br>
node2->setDataVariance(osg::Object::DYNAMIC);<br>
<br>
node1->setPosition((osg::Vec3f(0.f,0.f,0.f)));<br>
node2->setPosition((osg::Vec3f(0.f,0.f,0.f)));<br>
<br>
node1->addChild(node2.get());<br>
node1->setPosition(osg::Vec3f(10.f,10.f,10.f));<br>
<br>
osg::Vec3f pose2 = node2->getPosition();<br>
<br>
//pose2 is still at (0,0,0)<br>
<br>
<br>
<br>
<br>
<br>
<br>
//Regards Dan<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=76810#76810" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76810#76810</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div>