|
图片是我目前的窗口背景,模型有一部分被创建的背景遮挡住了,不知道各位有没有什么办法解决。先谢谢了!
创建背景的代码如下:如果把背景去掉,模型的显示是正常的,所以问题一定在创建背景的部分。请大家看看!!
-
- osg::Camera* camera = new osg::Camera();
- unsigned int width, height;
- osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
- wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
- camera->setProjectionMatrix(osg::Matrix::ortho2D(0,width,0,height));
- camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
- camera->setViewMatrix(osg::Matrix::identity());
- camera->setClearMask(GL_DEPTH_BUFFER_BIT);
- //HUD几何体的叶节点
- osg::ref_ptr<osg::Geode> HUDGeode = new osg::Geode();
- camera->addChild(HUDGeode);
- camera->setRenderOrder( osg::Camera::NESTED_RENDER );
- camera->getOrCreateStateSet()->setRenderBinDetails( 99999, "RenderBin" );
- camera->getOrCreateStateSet()->setAttribute( new osg::Depth(osg::Depth::LEQUAL) );
复制代码 |
|