Hi,

I am trying to write some more sophisticated input control on top of osg.
The one in osgWidget::Input is ok but I am to get it more feature rich. Now,
I have all the code almost done, and I come accross one issue:

Imagine you want to go left-right with cursor. This requires knowing the
position of each glyph in the text. YOu can get these informations from
osgText::getTextureGlyphQuadMap(). Now here is my point. In my test case my
text is spread over couple of TextureGlyphQuadMap entries. My question is
how to parse it based on the text input?

Here is some code snippet to get you the idea of what I am trying to do

osgText::Text::TextureGlyphQuadMap& tgqm =
const_cast<osgText::Text::TextureGlyphQuadMap&>(mText->getTextureGlyphQuadMap());
 osgText::Text::TextureGlyphQuadMap::iterator tgqmi = tgqm.begin();

std::cout << "Text size:" << mText->getText().size() << std::endl;
 for ( ; tgqmi != tgqm.end(); tgqmi++ )
{
const osgText::Text::GlyphQuads& gq = tgqmi->second;

std::cout << "Coords size:" << gq.getCoords().size() << ", " <<
gq.getCoords().size()/4.0 << std::endl;
 std::cout << "Transformed coords size:" <<
gq.getTransformedCoords(0).size() << ", " <<
gq.getTransformedCoords(0).size()/4.0 << std::endl;
 }

Thanks !
Nick

http://www.linkedin.com/in/tnick
Sent from Devlet, Ankara, Turkey
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to