[osg-users] Calling drawImplementation manually onaosgText::Text object

Argentieri, John-P63223 John.Argentieri at gdc4s.com
Tue Aug 28 06:51:52 PDT 2007


Robert,

If I have view frustum culling enabled, and I put the text on the screen
using native glOrtho() calls, but the text's transform only contains a
screen coordinate, would it get wiped out because of that? Should I be
using osg's transforms to make the HUD text? I think maybe it is being
culled when in fact it is being drawn on the screen using OpenGL
transforms. Does this sound feasible?

John 

-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Tuesday, August 28, 2007 4:48 AM
To: osg-users at lists.openscenegraph.org
Subject: Re: [osg-users] Calling drawImplementation manually
onaosgText::Text object

Hi John,

osgText::Text doesn't need an update traversal to sync itself after an
update, so it should be possible to update the text, draw the text,
update the text etc.  As to why this doesn't work in your case I do not
know, its hardly a part of design spec for osgText.

I would however suggest if you have multiple text entries on a single
then use multiple text objects.

Robert.

On 8/27/07, Argentieri, John-P63223 <John.Argentieri at gdc4s.com> wrote:
> Hi Robert.
>
> I got it to work a little bit better. I want our user to be able to 
> call this multiple times on a single post-draw event. The way it is 
> now, I am able to call the underlying osgText object's 
> drawImplementation once and it looks correct. The next time I call it,

> however, all I get is a series of squares where my letters should be. 
> I am guessing that this is because it must receive a visitor on the
update traversal or something.
> Is there a way I can get around this too?
>
> Thanks for all of your help over the last several months!
>
> John
>
> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org
> [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of 
> Robert Osfield
> Sent: Monday, August 27, 2007 3:33 PM
> To: osg-users at lists.openscenegraph.org
> Subject: Re: [osg-users] Calling drawImplementation manually on 
> aosgText::Text object
>
> Hi John,
>
> The closest code to what you are trying to achieve can be found in the

> osgProducer projects src/osgProducer/ViewerEventHandler.cpp where is 
> sets up the and renders the stats and help.
>
> In 2.x and osgViewer's stats and help I just go ahead and use a full 
> blown scene graph as it makes more things just more straight forward.
>
> Robert.
>
> On 8/27/07, Argentieri, John-P63223 <John.Argentieri at gdc4s.com> wrote:
> >
> >
> >
> > Hello all, and long time no see!
> >
> > I am trying to create an osgText::Text object and call 
> > drawImplementation on it manually. I think it is almost working. 
> > Here is how I am setting up the RenderInfo that I am passing in:
> >
> >          spState = new osg::State();
> >          spViewState =
> > spSceneView->getRenderInfo().getState();
> >          if( spViewState.valid() )
> >          {
> >             spState->setGraphicsContext(
> > spViewState->getGraphicsContext() );
> >             spState->setContextID( spViewState->getContextID() );
> >          }
> >          renderInfo = osg::RenderInfo( spState.get(),
> > spSceneView->getView() );
> >
> > The problem is, that the textures are being lost. Can anyone help me

> > to accomplish this without adding the osgText::Text to the 
> > sceneview's
>
> > scene data?
> >
> >
> > Much appreciated!
> > John
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> >
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> > org
> >
> >
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> or
> g
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> org
>
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g


More information about the osg-users mailing list