|
在场景中加了一个相机,相机能显示正确,可是当缩放窗口时,相机不能随着缩放,因为用 setViewport( 0,200,200,200 )设定了视口,有什么办法能将其缩放?
osg::Camera* p_camera = new osg::Camera;
p_camera->setProjectionMatrix(m_Viewer->getCamera()->getProjectionMatrix());
p_camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
p_camera->setViewMatrix(m_Viewer->getCamera()->getViewMatrix() );
p_camera->setViewport( 0,200,200,200 );
p_camera->setRenderOrder( osg::Camera:OST_RENDER );
root->addChild(p_camera); |
|