Hi guys,

I found and solved the problem! :D

When I grab the osg scene at first time, my view matrix is NaN; from the second 
time, this matrix is correctly filled. 

Then, I modified the grabImage method to replace when the view matrix is NaN by 
the identity matrix, as follows:


Code:

osg::ref_ptr<osg::Image> 
ImageViewerCaptureTool::grabImage(osg::ref_ptr<osg::Node> node) {
    // set the current root node
    _viewer->setSceneData(node);

    // if the view matrix is invalid (NaN), use the identity
    osg::ref_ptr<osg::Camera> camera = _viewer->getCamera();
    if (camera->getViewMatrix().isNaN())
        camera->setViewMatrix(osg::Matrix::identity());

    // grab the current frame
    _viewer->frame();
    return _capture->captureImage();
}




Thanks for all messages!

Cheers,

Rômulo

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





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

Reply via email to