Hi, Aaron If you set singlethreaded mode and stop threading on viewer you can skip Sleep() step. Used same thing couple of times :)
Cheers, Sergey. 27.06.2011, 20:11, "aaron wetzler" <aaronwetz...@gmail.com>: > SOLUTION > > For anyone who struggled with this here is my solution. > I really have no idea how "correct" it is but it works for me > > Code: > //Setup of the viewer and scenedata here > > osg::ref_ptr<osg::Camera> osgCam = viewer.getCamera(); > > osg::ref_ptr<osg::Image> colorImage= new osg::Image; > osg::ref_ptr<osg::Image> zImage = new osg::Image; > > colorImage->allocateImage(1024, 768, 1, GL_RGBA, GL_UNSIGNED_BYTE); > zImage->allocateImage(1024, 768, 1, GL_DEPTH_COMPONENT , GL_UNSIGNED_BYTE); > > osgCam->attach(osg::Camera::COLOR_BUFFER, colorImage.get()); > osgCam->attach(osg::Camera::DEPTH_BUFFER, zImage.get()); /* */ > > viewer.frame(); > > Sleep(100); > osgDB::writeImageFile(*colorImage.get(),"color.bmp"); > osgDB::writeImageFile(*zImage.get(),"depth.bmp"); > > Cheers, > aaron > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=40935#40935 > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org