**********ex,ey的坐标原点在窗口左下角************
bool HitTestCoordinateByPickHandle( float ex, float ey, double& dx, double& dy, double& dz )
{
if (m_pViewer==NULL)
return false;
osgUtil::LineSegmentIntersector::Intersections intersections;
if (m_pViewer->computeIntersections(ex, ey, intersections))
{
osg::Vec3f pos = intersections.begin()->getWorldIntersectPoint();
dx = pos[0];
dy = pos[1];
dz = pos[2];
return true;
}
return false;
}
osg光标点探测地理坐标
最新推荐文章于 2022-01-19 17:35:16 发布