查看: 942|回复: 2

oe场景多视图同步问题求助

[复制链接]

该用户从未签到

发表于 2015-7-17 11:47:54 | 显示全部楼层 |阅读模式
多视图同步问题,在win32下实现如下,
        while (!viewer.done())
        {
            //Reset the viewport so that the camera's viewport is static and doesn't resize with window resizes
            miniMapView->getCamera()->setViewport( 0, 0, miniMapWidth, miniMapHeight);   

            //Get the eye point of the main view
            osg::Vec3d eye, up, center;
            mainView->getCamera()->getViewMatrixAsLookAt( eye, center, up );

            //Turn the eye into a geopoint and transform it to the minimap's SRS
            GeoPoint eyeGeo;
            eyeGeo.fromWorld( mainMapNode->getMapSRS(), eye );
            eyeGeo.transform( miniMapNode->getMapSRS());

            //We want the marker to be positioned at elevation 0, so zero out any elevation in the eye point
            eyeGeo.z() = 0;           
        
            //Set the position of the marker
            eyeMarker->setPosition( eyeGeo );

            viewer.frame();
        }        

问题是,qt环境下如何动态设置小视图的视口呢?
osgViewer::CompositeViewer cViewer(arguments);
...
QWidget* viewerWidget = new ViewerWidget( &cViewer );//&viewer
MainWindow mainWin;
mainWin.setCentralWidget( viewerWidget );
mainWin.show();
...

qt与oe结合后原来的win32底下设置的代码
        while (!viewer.done())
等等在哪儿设置呢,请大侠指点,谢谢啦


初步效果

初步效果

该用户从未签到

 楼主| 发表于 2015-7-17 11:49:40 | 显示全部楼层
主要是qt处理
setCentralWidget
后,与oe的消息交互部分不是很清楚,知道的给个提示哈

该用户从未签到

发表于 2015-10-25 20:17:54 | 显示全部楼层
楼主解决了吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表