Hi Robert,
Thanks for the reply.  Turning off small feature culling does indeed
fix my problem, but it's not ideal.  I'm not sure I understand all the
details of what you're saying, but let me take a crack at it.  With
the current code you can a) turn off small feature culling, which will
get you a bounding box of size 0 on the first frame and a
reconstructed bounding box of the proper size on later frames, or b)
leave small feature culling on, which causes your text to never be
displayed.

If there must be an incorrect bounding box on the first frame, maybe
it should be just large enough to escape being culled as a small
feature.  Then small feature culling could be left on without any
trouble.  Of course, if there is any way to build a bounding box of
roughly the right shape and size with information about the text to be
drawn, that would probably be better.  It sounds to me like things
happen in the wrong order in OSG to make this practical or even
possible.
- Terry

>
> Message: 5
> Date: Thu, 23 Jun 2011 17:55:01 +0100
> From: Robert Osfield <[email protected]>
> To: OpenSceneGraph Users <[email protected]>
> Subject: Re: [osg-users] improperly culled osgText
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi Terry,
>
> The code is not ideal, but it does try to provide a bit of fallback
> for when one can't establish the actual bounding volume of a text item
> because it's scaling is dependent upon the current modelview matrix -
> something that it won't know until after the first frame.  The problem
> boils down to what size of bounding box is appropriate if you don't
> know what scale to use.  A zero scaling assumed is no more or no less
> valid than any other size, but it does mean that at least it won't be
> too large.
>
> I can see problems with the current implementation when small feature
> culling are on, and when the origin of the label is outside the view
> frustum but the label when eventually scaled correctly would inside
> the view frustum.  Is it one of these two cases that you hitting
> problems with?
>
> As to a robust solution that works in all cases, well it's a bit
> akward - you almost need to disable culling for the first frame for
> these Text drawables, then re-enable culling once they have a size.
>
> Robert.
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to