Hi,

This code works as I need that draws object on scene and does not move while I 
translate the scene but how can I add a node instead of a geode? I add directly 
the node but it did not seen on the screen.

ref_ptr<Geode> HUD = addHUD();
                ref_ptr<StateSet> stateSet = HUD->getOrCreateStateSet();

                stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
                stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);


   
                stateSet->setRenderBinDetails(11, "RenderBin");

                ref_ptr<MatrixTransform> modelviewAbs (new MatrixTransform);
                modelviewAbs->setReferenceFrame(Transform::ABSOLUTE_RF);
                modelviewAbs->setMatrix(Matrix::identity());

                modelviewAbs->addChild(HUD.get());

                ref_ptr<Projection> projection (new Projection());
                projection->setMatrix(Matrix::ortho2D(0, 1280, 0, 1024)); 
//traits->width traits->height
                projection->addChild(modelviewAbs.get());
                root->addChild(projection.get());

Thank you!

Cheers,
Tufan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23949#23949





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to