[osg-users] addSlave messup main cameras stateset
compressor at gmail.com
Mon Apr 18 22:15:11 PDT 2011
hi in order to display a rectangle roi over the 3d scene i use the example provided in osg hud. however before drawing the roi i press a toggle selection button which gets the stateset of the main camera as given below
osg::StateSet *stateSet = osg_viewer->getCamera()->getOrCreateStateSet();
osg::Point *pointState = (osg::Point*)stateSet->getAttribute(osg::StateAttribute::POINT);
The 2d rectangle is drawn by mouse drag using the handler function. In the handler function the slave camera is created and added to the viewer as addSlave.
camera_slaveBBox = createBBoxCamera();
As the mouse the dragged the rectangle is drawn and all is good untill......On pressing the toggle selection button again in the first code "stateSet" is now returned NULL :(
Now if i comment
then stateSet indeed has some value. whats is the problem?
Read this topic online here:
More information about the osg-users