Hi all, I have a viewer from wihch i take some snapshot. The code is something like this:
r_Viewer = new osgViewer::Viewer(); r_Viewer->setSceneData(p_RootNode); p_hWND = reinterpret_cast<HWND> (wnd); osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits(); traits->inheritedWindowData = new osgViewer::GraphicsWindowWin32::WindowData( p_hWND ); [...] // some init stuff [...] osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext (traits.get()); osg::ref_ptr<osg::Camera> camera = r_Viewer->getCamera(); camera->setGraphicsContext (gc.get()); camera->setViewport (...); camera->setProjectionMatrixAsPerspective (...); p_ScreenShot = new osg::Image; camera->attach(osg::Camera::COLOR_BUFFER, p_ScreenShot); [...] r_Viewer->frame(); // Note that i call "frame()" on demand. [...] p_ScreenShot->readPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE); This work fine. The question is: what if i need to take an offscreen screenshot? In particular I need to take a snapshot of the same scene from a different point of view, but without render it. Is this possible? Thank you. Best regards. Giulio ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39594#39594 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

