Hi Franclin, There is no formal mechanism for what you are after, rather you'll need to create a solution from general purpose functions available. There are few different ways to do what you are after...
First up you could do a local check, where you assume that the the other node is a sibling, and just directly go gets its local information via an pointer stored in the callback. For instance if you know that the other node is a MatrixTransform you could simply store a osg::observer_ptr<MatrixTransform> in your callback. The other method would be store the NodePath to the other node, and use compute osg::computeLocalToWorld(otherNodePath) method to get the local to world transform for this, then to get the position back relative to the orignal node you then multiply this by the result of osg::computeWorldToLocal(myLocalNodePath) where myLocalNodePath can be got for the NodeVisitor passed into the callback. Robert. On 8/7/07, Franclin Foping <[EMAIL PROTECTED]> wrote: > Hi everyone, > I am a newbie in OSG. > My scene consists of 2 objects, say A and B. To update their positions > they use a callback and a user data. A and B have the same parent. Is there > a mechanism to request the position of the other object in the callback of > the other object? For instance within the callback of A, I would like to > request the position of the node B. > Thanks in advance for your reponse. > Kind regards, > Franclin > > ________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! > Mail > _______________________________________________ > 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

