|
多视图同步问题,在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())
等等在哪儿设置呢,请大侠指点,谢谢啦
|
-
初步效果
|