Hi OSG lovers, I would like to discuss about the following code snippet, which appears in the Beginner's Guide for obtaining a node's position:
Code: osg::Vec3 posInWorld = node->getBound().center() * osg::computeLocalToWorld(node->getParentalNodePaths()[0]); In principle, this code is aimed to providing the position of a node in the world, regarding its local center and its node path. However, getParentalNodePaths()[0] returns the node path of the scene graph all the way down to the current node, including it. Therefore, the position in the world is incorrectly calculated, resulting in a multiplication of the node's center twice. One possible workaround for this would be to multiply by a (1.,1.,1.) vector, otherwise it's possible to strip the last node from the path. Should getParentalNodePaths return only the path up to the parent, or is this the desired behaviour? Thank you! Cheers, Daniel ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39504#39504 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

