Matt Caron wrote:
I found a solution for this task using a HUD:

http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/HudsAndText

Although I do still have an issue.  I am using the Cessna.osg model in the HUD 
but when I do


Code:

myPlaneTrans->setStateSet(hudStateSet);
hudStateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);




many of the triangles in the Cessna model are not rendered, or are rendered 
black.  Unfortunately if I don't use that setMode() method, the Cessna 
sometimes appears behind other objects - so it seems I really need 
GL_DEPTH_TEST off, but I don't know why the Cessna mesh is being rendered 
incorrectly.

The HUD tutorial probably assumes you don't have true 3D objects on your HUD. To properly render anything 3D, you'll need the depth test on.

One possible solution would be to clear the depth buffer (but not the color buffer) before drawing your HUD objects, but you'll have to make sure that your HUD objects are always drawn after the regular scene.

--"J"

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

Reply via email to