Hi John-Luke,

The osgUtil::IntersectionVisitor/LineSegmentIntersector is based of pure
geometry calculations, there isn't any reference to rendering elements so
has no knowledge of what may or may not have been rendered.

If you want to have picking based on rendering results you'll need to
implement your own scheme based on OpenGL rendering of the scene.  There
are a range of ways to tackle it's quite a bit more complicated than just
using the OSG's standard intersection classes.

Robert.

On 2 March 2015 at 21:46, John-Luke Laue <jlguitar...@gmail.com> wrote:

> Hi all,
>
> Hopefully this isn't too newbie a question.
>
> Let's say I have a camera at the origin, looking down +x axis.
> I have a cube at position (1,0,0) and a sphere at position (5,0,0).
>
> If I render my scene normally, I will see (from the camera) the cube, but
> not the sphere because it is occluded by the cube. When I use the osg
> picker to pick with my mouse, it will pick the cube first, then the sphere.
>
> Next, I disable depth testing and give the sphere a higher render order
> than the cube. When I render my scene again, now I see the sphere and not
> the cube.
> However, if I use my picker again, the picker still picks the cube first,
> and then the sphere.  I want the opposite.
>
> Which leads me to my question: Can the osg picker order the picking based
> on render order or is it always by depth only?
>
> Thank you for your time!
>
> Cheers,
> John-Luke
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=62916#62916
>
>
>
>
>
> _______________________________________________
> 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