I check if the intersection belongs to the correct node:

        osgUtil::LineSegmentIntersector::Intersections intersections;
        osgUtil::LineSegmentIntersector::Intersections::iterator intersection;
        
        marked.isActive = false;
        bool result = viewer->computeIntersections(mouse.x(), mouse.y(),
intersections);
        if (result)
        {
                notify(DEBUG_INFO) << intersections.size() << " intersections:" 
<< endl;
                for (intersection = intersections.begin();
                         intersection != intersections.end();
                         intersection++)
                {
                        notify(DEBUG_INFO) << intersection->nodePath << endl;
                        NodePath nodePath = intersection->nodePath;
                        if (intersection->nodePath.size() >= 3 &&
                                intersection->nodePath[2]->asGroup() == 
modelGroup.get())
                        {
                                marked.isActive = true;
                                break;
                        }
                }
        }


Night Hawk wrote:
> Hello All,
> 
> I am using the pick example code in my app to display the objects
> under the mouse. The results as usual are displayed in a text lable
> hud.
> 
> However, when the text length grows, it comes under mouse and even
> that is also getting picked up and displayed. I do not want the
> display "text lable" HUD to be picked up.
> 
> Tried modifying the Z value of the hud etc... but did not get much
> difference. I see that the HUD is declared as "post render" element.
> Not sure why it gets picked up.
> 
> I see that there is some "traversal mask" to be used. But did not find
> much info on how to use it? What should be the mask that I set to the
> Text HUD to make it non pickable?
> 
> Any help is appreciated.
> 
> Thank you.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
begin:vcard
fn:Per Rosengren
n:Rosengren;Per
org:Royal Institute of Technology (KTH);Computational Vision and Active Perception Laboratory
adr:;;Teknikringen 14, room 621;Stockholm;;11428;Sweden
email;internet:[EMAIL PROTECTED]
title:Ph.D. student
tel;work:+46 8 7906203
note:PGP keyID: 0xD40DD8E0
x-mozilla-html:FALSE
url:http://www.csc.kth.se/~perrose/
version:2.1
end:vcard

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to