[osg-users] Moving osgHud

Martin Beckett mgb at mgbeckett.com
Fri Mar 27 17:14:27 PDT 2009

Sorry I meant an ordinary Hud as in the osghud sample.

> * Add a Camera Node to your scene graph, configured to post render, and set the Camera's View and Projection to allow screen-space rendering (just as you would for any normal HUD). 

That's what I did.

> * Attach a Geode (with a Geometry) as a child of this Camera. 
> * When you get a mouse down event, configure the Geometry to render a 4-vertex line loop, and initialize the 4 vertices to the current mouse 
> position. 

Yes - that's what I was doing, based on the keyboardmouse example.

> * As you get mouse drag events, update the vertices/corners of the line loop to reflect the rectangle that the user is defining. 

That's the sticking point - the Hud camera is attached to the scene as a geode, how do I change the vertices in a node that's part of the scenegraph?

> * When you get a mouse up event, define a frustum from the 4 vertices, the near/far planes, and your viewpoint, and intersect this with your scene graph.

Shouldn't I use a PolytopeIntersector ?


Read this topic online here:

More information about the osg-users mailing list