[osg-users] [forum] Dragging individual model nodes

Maxim Senin ok23senya at yahoo.com
Wed Apr 24 01:14:33 PDT 2019


icf80 wrote:
> Hi,
> 
> You have to find the node associated to your object by intersection:
> 
> 	osgUtil::LineSegmentIntersector::Intersections ints;
> 	bool bHasIntersections = viewer->computeIntersections(viewer->getCamera(), osgUtil::Intersector::WINDOW, x, y, ints, CULL_MASK_HERE);
> 
> 	if (bHasIntersections)
> 	{
> 		const osgUtil::LineSegmentIntersector::Intersection& inter = *(ints.begin());
> 
> 		const osg::NodePath& nodePath = inter.nodePath;
> 		unsigned int idx = nodePath.size();
> 		while (idx--)
> 		{
> 			osg::Node*node =nodePath[idx];
> 
> ....
> 
> 
> Thank you!
> 
> Cheers,
> Catalin

Yes, I found the necessary node, what should I do next?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75883#75883







More information about the osg-users mailing list