HI Liu,

Do to custom OpenGL calls after the main view has rendered add use a
osg::Camera FinalDrawCallback.  The following OSG examples implement
final draw callbacks so have at look at them for guidance:

~/OpenSceneGraph/examples$ grep FinalDrawCallback */*.cpp
osgatomiccounter/osgatomiccounter.cpp:
viewer.getCamera()->setFinalDrawCallback(drawCallback);
osgautocapture/osgautocapture.cpp:
viewer.getCamera()->setFinalDrawCallback(new
WindowCaptureCallback(buffer, fileName));
osgframerenderer/osgframerenderer.cpp:
camera->setFinalDrawCallback(screenShot.get());
osgframerenderer/osgframerenderer.cpp:
camera->setFinalDrawCallback(screenShot.get());
osghud/osghud.cpp:        SnapImage* finalDrawCallback = new
SnapImage("FinalDrawCallback.png");
osghud/osghud.cpp:
viewer.getCamera()->setFinalDrawCallback(finalDrawCallback);
osgscreencapture/osgscreencapture.cpp:
lastCamera->setFinalDrawCallback(callback);
osgscreencapture/osgscreencapture.cpp:
camera->setFinalDrawCallback(new WindowCaptureCallback(mode, position,
readBuffer));

Robert.

On 23 June 2014 19:33, Liu PeiFu <[email protected]> wrote:
> Hi,
>
> ...
> I just want to do the same things as the following code does:
> glReadPixels(e->x(),height()-e->y(),1,1, GL_DEPTH_COMPONENT, GL_FLOAT, 
> &gloablewinZ);
>  So how can do it in osg?
> Thank you!
>
> Cheers,
> Liu
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59859#59859
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to