| 505 | | osg::Projection* projection = new osg::Projection; |
| 506 | | projection->setMatrix(osg::Matrix::ortho2D(0,1280,0,1024)); |
| 507 | | |
| 508 | | osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; |
| 509 | | modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); |
| 510 | | modelview_abs->setMatrix(osg::Matrix::identity()); |
| 511 | | |
| 512 | | modelview_abs->addChild(createHUDText()); |
| 513 | | |
| 514 | | projection->addChild(modelview_abs); |
| 515 | | |
| 516 | | group->addChild(projection); |
| | 504 | osg::CameraNode* camera = new osg::CameraNode; |
| | 505 | camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); |
| | 506 | camera->setProjectionMatrixAsOrtho2D(0,1280,0,1024); |
| | 507 | camera->setViewMatrix(osg::Matrix::identity()); |
| | 508 | camera->setClearMask(GL_DEPTH_BUFFER_BIT); |
| | 509 | camera->addChild(createHUDText()); |
| | 510 | camera->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF); |
| | 511 | |
| | 512 | group->addChild(camera); |