您的位置:首页 > 其它

osg 屏幕坐标和世界坐标转换

2016-01-22 16:19 423 查看
//屏幕-〉世界:
osgUtil::SceneView::projectWindowIntoObject
//或者自己运算
Matrix VPW = camera->getViewMatrix() *
camera->getProjectionMatrix() *
camera->getViewport()->computeWindowMatrix();
Matrix inverseVPW = Matrix::inverse(VPW);
Vec3d world = window * inverseVPW;


//世界-〉屏幕:
osgUtil::SceneView::projectObjectIntoWindow
//或者自己运算
Matrix VPW = camera->getViewMatrix() *
camera->getProjectionMatrix() *
camera->getViewport()->computeWindowMatrix();
Vec3 window = world * VPW;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: