原文链接:https://blog.csdn.net/yang_sen_/article/details/84564583
// 屏幕坐标转世界坐标
osg::Vec3d ScreenToWorld(const osg::Vec3d screen)
{
osg::Camera* camera = _global->Viewer->getCamera();
osg::Matrix VPW = camera->getViewMatrix() * camera->getProjectionMatrix() * camera->getViewport()->computeWindowMatrix();
osg::Matrix inverseVPW = osg::Matrix::inverse(VPW);
osg::Vec3d world = screen * inverseVPW;