[osg-users] Moving osgHud

Martin Beckett mgb at mgbeckett.com
Mon Mar 30 15:20:10 PDT 2009


[quote="Paul Martz"] You have the address of the vertex array
(because you created it) so when you get mouse drag events (by definitionthey are outside the draw traversal), just modify the points.
[/quote]
thanks - it seemed a little crude to just change the vertex data directly.

ps. for the archives:
osg::Geode *geode = camera->getChild(0)->asGeode();
osg::Geometry *geom = geode->getDrawable(0)->asGeometry();
osg::Vec3Array* vertices = (osg::Vec3Array*)geom->getVertexArray();

To get the value:  float x = (*vertices)[0].x();
And to modify them  (*vertices)[0]._v[0] = x;

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=9468#9468








More information about the osg-users mailing list