|
发表于 2014-11-6 23:38:15
|
显示全部楼层
本帖最后由 jeepyutian 于 2014-11-6 23:39 编辑
//新建一个viewer
osg::ref_ptr<osgViewer::Viewer> newView = new osgViewer::Viewer;
//设置新的viewer的位置,背景颜色等
newView ->getCamera() ->setViewport(new osg::Viewport(x, y, width, height);
newView ->getCamera() ->setClearColor(osg::Vec4(44.0/255.0,61.0/255.0,90.0/255.0,1.0));
newView ->getCamera() ->setClearMask(GL_COLOR_BUFFER_BIT);
newView ->getCamera() ->setGraphicsContext(gc);
newView ->setSceneData(node);
newView ->setCameraManipulator(new osgGA::TrackballManipulator());
然后在这个viewer里显示你需要的角度就可以了吧 |
|