Hi, After some more searching I found that there is already a BOUNDINGBOX draw mode in osgText::Text. It draws an outline around the block of text. It looks unfinished, though, because it can only draw with colorMultiplier as the color and it has no extra margin. It's easy to adapt this to draw a GL_QUAD insead of a GL_LINE_LOOP. We could called this mode FILLED_BOUNDINGBOX or something. My prototype works, but it will take me a bit longer to make it tidy. It should probably work with all the options for _backdropImplementation (POLYGON_OFFSET, NO_DEPTH_BUFFER, DEPTH_RANGE, and STENCIL_BUFFER).
I don't have much knowledge of osgText besides what I learned yesterday by looking at the code. If anyone has any idea how this approach should be changed or improved, I'd like to hear it before I finish programming this. -- Terry Welsh / mogumbo 'at' gmail.com www.reallyslick.com / www.mogumbo.com > > Message: 7 > Date: Tue, 21 Jul 2009 21:04:04 -0400 > From: Jean-S?bastien Guay <[email protected]> > Subject: Re: [osg-users] rectangle behind osgText > To: OpenSceneGraph Users <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi Terry, > >> Does OSG have any sort of convenience routine for drawing a >> semi-transparent rectangle behind a block of osgText? This would make >> text a little easier to read against distracting background imagery. > > Not that I know of, but you're right, it's something that I have often > needed to do. The osghud example shows that it's pretty easy to do it by > taking the axis-aligned bounding box of the text and making a quad of > that size (of course I'd personally add a small margin all around, but > that could be a parameter in the convenience function). > > Feel free to submit it. I, for one, would use it. > > J-S > -- > ______________________________________________________ > Jean-Sebastien Guay [email protected] > http://www.cm-labs.com/ > http://whitestar02.webhop.org/ _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

