2009/5/22 Simon Hammett <[email protected]>:
> 2009/5/22 Paul Griffiths <[email protected]>:
>> Im clipping an osg::group with an osg::ClipNode so parts of it is invisible 
>> on screen but when i click on the invisible parts the picker is still 
>> picking the object . i dont want it like that, i want the invisible parts to 
>> be invisible to the mouse as well. so i wish to create an aabb around the 
>> parent picked node the same size and position as the clipNode and check if 
>> getWorldIntersectPoint is within this aabb.
>>
>> if there is a way to check if getWorldIntersectPoint is outside a clipnodes 
>> assigned bounding box then that would be even better.
>>
>>
>> It's for a scrollpanel for my new 3d gui system.
>>
>
> If you have a clip node in world coordinates, you can just test the
> world intersect point against that.
>
> for each clip plane in the clip node, call getClipPlane,
>
> this gives you a vec4d which is the plane equation.
> calc the distance from the plane and if it's negative it's outside.
>
> distance is pt.x() * pl.x() + pt.y() * pl.y() + pt.z() * pl.z() + pl.w()
> where pt is the intersection point
> and pl is the vec4 of the plane
>
> --
> http://www.ssTk.co.uk
>

It's also worth noting, that the LineSegmentIntersector::Intersection
result has a nodePath member which is the trace from the top of the scene
graph to that node.

This can be used with the functions in osg/Transform to give you various
useful matrices.

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

Reply via email to