[osg-users] Iterating over all vertices in scene

Robert Osfield robert.osfield at gmail.com
Mon May 18 00:03:33 PDT 2015

Hi Matt,

Use a combination of custom NodeVisitor to traverse the scene, and an
osg::Drawable::ArrayFunctor to traverse the vertices.  When you handle
the Drawable's you can get the world transform by either accumulating
the transform yourself during the NodeVisitor traversal or use
osg::Node::getWorldMatrices() or osg::computeLocalToWorld(NodePath)
using the NodeVisitor::getNodePath() for the node path.


On 18 May 2015 at 06:34, Matt Donahoe <matt at skyd.io> wrote:
> Hi,
> I would like to build and export a point cloud from all the vertices in my scene. Ideally I would be able to iterate over all the vertices in global coordinates. Can someone point me in the right direction?
> I assume I need some kind of NodeVisitor. I have been reading the MeshOptimizer code, but I am wondering if there is a simpler way to get the vertex data transformed into the global frame.
> Thank you!
> Cheers,
> Matt
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=63752#63752
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list