Just for anyone trying this here is what I have for code
Code:
std::int64_t M_OSG_viewer::Draw(void)
{
_last_draw_time_us = _last_draw_timer.Get_elapsed_us();
if(_has_slave_cam)
{
//_sl_cam_mount is a matrixTransorm attached to the node I
would like to track
osg::View::getSlave(0)._camera->setViewMatrix(_sl_cam_mount->getInverseMatrix());
//_sl_camera->setViewMatrix(_sl_cam_mount->getInverseMatrix());
//crashes, not sure why
}
if(_last_draw_time_us > 8333)
{
osgViewer::Viewer::getViewerBase()->frame();
_last_draw_timer.Restart();
}
return _last_draw_time_us;
}
I also use
Code:
_sl_camera->addChild(_sl_scene);
where _sl_scene is group containing only relevant parts of the larger main
scene, in this way I can avoid rendering my HUD in what the _sl_camera sees as
well as alter lighting for the mounted camera. I will be putting the output of
the captures onto the HUD after processing the images so it may look silly to
have the HUD rendered inside the HUD etc. The slave camera is set up to render
to PBO similar to the osgscreencaptue example but I found it necessary to add
Code:
_sl_camera->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
since using only
Code:
_sl_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
caused some problems.
Patrick
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58641#58641
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org