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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org