Hi Jeremy, This type of usage isn't one that has been coded into osgText::Text, which is why your not finding it easy to extract the data in a way you need. The route you have picked seems reasonable, but I haven't tried such a task myself so can't say.
Robert. On Mon, Mar 24, 2008 at 7:19 PM, Jeremy Moles <[EMAIL PROTECTED]> wrote: > Is there a standard/preferred way to iterate over every "character" in > an osgText instance in order to query information about it's location, > etc? I'll need to be able to do this for osgWidget--in particular, to be > able to position a "cursor" properly within a bit of text. I have the > following code: > > ------------------------------------------------------------------ > > const osgText::Text::TextureGlyphQuadMap& tgqm = > _text->getTextureGlyphQuadMap(); > > const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = > tgqm.begin(); > > const osgText::Text::GlyphQuads& gq = tgqmi->second; > > for(unsigned int i = 0; i < gq.getGlyphs().size(); i++) { > osg::Vec2 c2 = gq.getCoords()[i]; > osg::Vec3 c3 = gq.getTransformedCoords(0)[i]; > } > > ------------------------------------------------------------------ > > In the above code, should c2 and c3 be sufficient for this purpose? They > don't appear to contain the values I "expect", but this is almost > certainly because I'm misusing it... > > Also, this may be one of the things you'll be recoding in osgText when > the time comes, so perhaps it may be best for me to simply wait until > then before tackling this issue. > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org