Hi Uma,

On 19 December 2016 at 09:08, Uma Devi Selvaraj <[email protected]> wrote:
>       Can somebody tell me is it possible to get pixel value from x and y 
> co-ordinates?


You can implement a draw callback that uses glReadPixels() if you want
the actual pixel value.  This however limits to you doing the
operation in the draw traversal and forces a round trip to the GPU
which is slow process.

Normally when you want to intersect the scene at the mouse x,y
position you'll using osgViewer::View::computeIntersections() or the
osgUtil::IntersectionVisitor with  LineSegmentIntersector.  You can
get the intersection values and tex coords from the intersection which
then can be used to query the osg::Texture and finally the osg::Image
for it's value.  This route is CPU based and avoids the round trip
cost.

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

Reply via email to