Hi,

I'm working on a system in which we already have a post render camera onto 
which we're displaying text data as overlays to the 3D environment. Kind of 
like a heads-up display. That's working just fine. In addtion to the this 
post-render cameras that the overlays are placed on, we're also adding on 
additional osg::View object to the main window (which is a CompositeViewer) as 
window insets for alternate camera views to the data. No problem there either.

My question to the learned audience is: Now I want to add a post-render camera 
onto one of the secondary views (the insets).  I have constructed a new 
osg::Camera identical to the one functioning one on the main window (except for 
the Viewport and projectionMatrix coordinates). However, when I'm creating the 
inset and add the new post-render camera as a slave to the inset's View, I 
don't see any of the text I'm attaching to the camera.

I know this is at a high level but I'm concerned that perhaps the post-render 
capability is somehow limited in the rendering pipeline.

The code to create the camera is:


Code:
osg::ref_ptr<osg::Camera> overlayCamera = new osg::Camera;

// Initialize PostRenderCamera
overlayCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
overlayCamera->setViewMatrix(osg::Matrix::identity());

// Only clear the depth buffer
overlayCamera->setClearMask(GL_DEPTH_BUFFER_BIT);

// Draw subgraph after main camera view.
overlayCamera->setRenderOrder(osg::Camera::POST_RENDER);

// Don't let the camera grab event focus from the viewers main camera(s).
overlayCamera->setAllowEventFocus(false);

// Set up camera to rendering on the inset view.
overlayCamera->setGraphicsContext(insetView->getCamera()->getGraphicsContext());
insetView->addSlave(overlayCamera.get(), false);

// Height and width are the dimensions of the inset view
overlayCamera->setViewport(0, 0,(int)(0.3 * width), (int)(0.3 * height));
overlayCamera->setProjectionMatrixAsOrtho2D(0, (int)(0.3 * width), 0, (int)(0.3 
* height));

// Add text to the camera...


Adding the text.overlays to this slave camera is the same as being done to the 
main window's slave camera.

As I said, this is the same camera creation process as the post-render slave 
camera on the main window which works.

The inset does come up into the main window but no overlay text from its slave 
camera created with the code above.

Any thoughts would be appreciated.
Thanks,

Cheers,
Tom

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to