[osg-users] OSG Advice on Model Viewer Program

Oran Wallace oowallace at gmail.com
Wed Jun 3 16:03:20 PDT 2015

Hello again,

So I've implemented much of what I originally wanted but seem to have hit a road block...that I can't find any threads or posts about.

I've got my osg::Geometry nodes and used the PickHandler class from osgkeyboardmouse to get a quick proof of concept So far everything in it works, even the osgFX scribe being applied to the selected geometry. 

Now Im attempting to change the color of the selected node. I do this by using a class derived from the NodeVisitor and reimplement the apply method and set the ColorArray/Binding there. I know the visitor is working because if I give it to the root of the my scene graph it applies the color. But If I use the last node from osgUtil::LineSegmentIntersector::Intersections nodelist nothing happens... Does this have to do with this node being changed during an event? After research it seems I might have to give the node a callback...? Also another problem I see is currently I dont have full control of the render loop...

Similar to the osgviewerQt example I'm using a class deriving from QWidget and osgViewer::CompositeViewer and reimplementing the paintEvent and calling frame() from there (eventually I want to use the setRunFrameScheme(ON_DEMAND)). I noticed this comment in the keyboardmouse example "// main loop (note, window toolkits which take control over the main loop will require a window redraw callback containing the code below.)" Is this what I need to do? 

Again any help is greatly appreciated!

Thank you!


Read this topic online here:

More information about the osg-users mailing list