|
osg::Vec3d window1(this->mpRefGlobeWidgetEx->width() / 2 - 64, this->mpRefGlobeWidgetEx->height() / 2, 0);
osg::Matrix m1 = this->mpRefGlobeWidgetEx->getCamera()->getViewMatrix();
osg::Matrix m2 = this->mpRefGlobeWidgetEx->getCamera()->getProjectionMatrix();
osg::Matrix m3 = this->mpRefGlobeWidgetEx->getCamera()->getViewport()->computeWindowMatrix();
osg::Matrix VPW = m1 * m2 * m3;
osg::Matrix inverseVPW = osg::Matrix::inverse(VPW);
osg::Vec3d world = window1 * inverseVPW;
移植到3.6.5后,计算出来的VPW和以前不一样了,不知道原因。
请指导!! |
|