Okay, so it's a problem that can't be solved properly without some major refactoring. In the meantime, I propose changing this:
bbox.set(_position, _position); to this: bbox.set(_position - Vec3(1.0, 1.0, 1.0), _position + Vec3(1.0, 1.0, 1.0)); It's still a hack :) but I think it's better because now text that takes this code will get drawn instead of staying invisible forever. I suppose it's still possible for text to get culled as a small feature this way, but it *always* gets culled the other way. -- Terry Welsh mogumbo 'at' gmail.com www.reallyslick.com > > Message: 24 > Date: Fri, 24 Jun 2011 13:57:59 +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, > > On Thu, Jun 23, 2011 at 9:43 PM, Terry Welsh <[email protected]> wrote: >> Thanks for the reply. ?Turning off small feature culling does indeed >> fix my problem, but it's not ideal. > > It's not ideal at all, I'd call it hack ;-) > > I guess another hack would be to switch off culling off for the first frame > and then re-enable. > >> ?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. > > You are reading things correctly, as things stand the view dependent > settings in osgText cause problems with sizing and computing bounding > volumes for the first frame. Having a view dependent text in two different > views will also cause similar issues with the bounding volume. > > I don't think there is any easy solutions without rejigging a number of design > elements. For instance if I was write osgText::Text now I wouldn't put any > of the view dependent support into it. Instead this should be provied by > osg::AutoTransform, osg::Billboad or similar node level support. This will > solve part of the problems, but there still is the issue with view dependent > subgraphs and their bounding volumes which would need some resolution > at the node level, unfortunately I don't know just what right now. > > Robert. > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

