Hi Aaron,

Is there any reason why an osg::Camera FinalDrawCallback wouldn't work
fine for handling the writes when required?  This would work fine for
multi-threaded usage and any length of time the the rendering would
take.

Robert.

On Mon, Jun 27, 2011 at 5:11 PM, aaron wetzler <aaronwetz...@gmail.com> wrote:
> 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

Reply via email to