tim hartter schrieb:
Hi,

I'd like to change the Position of an Object in my Scene after picking it by mouse picking. I already have a ref_ptr, call it m_Node, pointing to the Object I want to move, but I don't know how to apply the changes correctly. I don't want to insert another MatrixTransform, I'd like to modify the original one to translate the Object to the new position.

something like this?


osg::MatrixTransform* mat = dynamic_cast<osg::MatrixTransform*>(m_node);
if (mat) {
        
        mat->setMatrix(      mat->getMatrix() *
                        osg::Matrix::translate(x,y,z) );
}

Something similar to this code should work,

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

Reply via email to