thank you , Robert.     you solved my problem.   



wh_xiexing

From: Robert Osfield
Date: 2012-08-23 18:53
To: OpenSceneGraph Users
Subject: Re: [osg-users] HUD disappeared
Hi wh? xiexin? Which human name would you like to be addressed as?

There isn't any way we'll be able to pinpoint the problem you are
seeing from just this code extract, there are simply too many unknowns
about the rest of your application to pass judgement.

The best I can do is provide a general comment.  For on HUD compass I
would recommend using a viewer slave Camera rather than a Camera in
the main scene graph - this keeps the various components of the
application behaviour nice and separate both conceptually and
implementation wise.  It might even solve the bug you are seeing as
for all we know it might simply be that you are replacing the main
scene graph with your new model and discarding the compass subgraph.

Robert.


On 20 August 2012 03:17, wh_xiexing <[email protected]> wrote:
> i create a compass on the screen, but when i open an model , the HUD Compass
> disappeared .   following is my code.
>
> can some one tell me how to resolve this problem?
>
> //create hud camera
> theCameraNode = new osg::Camera;
> theCameraNode->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
> theCameraNode->setProjectionMatrix(osg::Matrix::ortho2D(-1,1,-1,1));
> theCameraNode->setViewMatrix(osg::Matrix::identity());
> theCameraNode->setViewport(0,0,200,200);
> theCameraNode->setClearMask(GL_DEPTH_BUFFER_BIT);
> theCameraNode->setRenderOrder(osg::CameraNode::POST_RENDER);
> theCompass = new ocsCompass;      // compass node
> theCameraNode->addChild(theCompass);
> addChild(theCameraNode);
>
> ________________________________
> wh_xiexing
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to