Hi Jimmy,

I just stumbled across this thread when searching for a similar solution,
and found it very interesting. Would you be prepapred to share some of your
code for a 3D Axis in the HUD? I'd understand if not.

Otherwise - what is the basic principle?

I have a HUD added to my scene as a seperate camera, this uses an ortho2D
projection and an identity view matrix as in the osgHUD example.

On this I'd like to add a 3D Axis. Should I just create the Geode for the
axis (with an update callback to reorient it) and plop it in the lower left?
Or do I require a separate HUD for the 3D element?

Thanks in advance,

Andrew

On Thu, Aug 20, 2009 at 9:04 AM, Robert Osfield <[email protected]>wrote:

> Hi Jimmy,
>
> If you are doing the frame loop you know when it's the first frame
> before you just place any viewer setup prior to the frame loop.  The
> _firstFrame code block you see if just a fallback in case the viewer
> hasn't already been setup.
>
> Robert.
>
> On Wed, Aug 19, 2009 at 10:49 PM, Jimmy Lin<[email protected]> wrote:
> > Hi,
> >
> > Here is the code of frame()
> >
> >
> > Code:
> > void ViewerBase::frame(double simulationTime)
> > {
> >    if (_done) return;
> >
> >    if (_firstFrame)
> >    {
> >        viewerInit();
> >
> >        if (!isRealized())
> >        {
> >            realize();
> >        }
> >
> >        _firstFrame = false;
> >    }
> >    advance(simulationTime);
> >
> >    eventTraversal();
> >    updateTraversal();
> >    renderingTraversals();
> > }
> >
> >
> >
> > It calls viewerInit() on the first frame.
> > Don't I need to do that myself if I expand the code?
> > By looking at the viewerInit() code. I think I might be able to expand
> the code and init all the view I created.
> >
> > Thank you!
> >
> > Cheers,
> > Jimmy
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=16447#16447
> >
> >
> >
> >
> >
> > _______________________________________________
> > 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