|
我尝试向根节点增加Camera以实现HUD,我使用如下代码:
m_pCamera->setViewport(400,400, GetWidth(),GetHeight());
m_pCamera->setRenderOrder(osg::Camera:OST_RENDER, 10);
m_pCamera->setProjectionMatrix(osg::Matrix:rtho2D(0.0,GetWidth(),0.0,GetHeight()));
m_pCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
m_pCamera->setViewMatrix(osg::Matrix::identity());
// only clear the depth buffer
m_pCamera->setClearMask(0);
m_pCamera->setRenderer(new osgViewer::Renderer(m_pCamera.get()));
不知道为什么绘制的图形原点老是在左下(0,0)点呀,我明明设置开始位置为(400,400)点?? |
|