[osg-users] Effecting MatrixTransform matrix change

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Wed May 27 06:22:50 PDT 2020


Hello everyone! This must be a simple one... I have a node that has one 
parent which is a MatrixTransform. I simply need to move the child node to 
a specific location that is computed at run time. I figured I just needed 
to do the following, but this caused no change in the location of the node:

const osg::Matrix OriginalParentMatrix = 
pParentMatrixTransform->getMatrix();

osg::Matrix TranslateContribution;
TranslateContribution.makeTranslate(10.0f, 0.0f, 0.0f);

const osg::Matrix FinalNewMatrix = (OriginalParentMatrix * 
TranslateContribution);

pParentMatrixTransform->setMatrix(FinalNewMatrix);

No matter what translation I set in makeTranslate(), the child node doesn't 
move. Is there some call I'm missing to cause the new matrix to take effect 
on the node's parent matrix transform? Thank you in advance!

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/26bd1277-4323-4140-a080-a474b9273dc5%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200527/0d66114a/attachment.html>


More information about the osg-users mailing list