Re: [osg-users] How to change the text with osg::Text?
It works very well. :) Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50622#50622 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to change the text with osg::Text?
Hi, I am a very new, and i got a problem with using osg::Text. I set the text like this blow. osg::Geode* textGeode = new osg::Geode(); osgText::Text* textLabel = new osgText::Text(); root-addChild(textGeode); // root is a point of osg::group() then, i want to display the numbers being continuelly increasing. the screen I guess will be showen up like this. 0, 1, 2, 3, 4, 5.. In order to achieve this, I typed code within while roop. wchar_t strTmp[100]; swprintf(strTmp, L%.3d, 0); textLabel-setText(strTmp); int index = 0 ; while(!viewer.done()) { swprintf(strTmp, L%d, ++nIndex); textLabel-update(); viewer.frame(); } However, the result is stopped. I think the problem is related to textLabel-update() line. Please, anyone tell me how to change (or update) the text frequently? Thank you! Cheers, Eungil -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50600#50600 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to change the text with osg::Text?
Hi call textLabel-setText(strTmp); instead of update() Cheers. 15.10.2012, 13:42, Eungil slwa...@naver.com: Hi, I am a very new, and i got a problem with using osg::Text. I set the text like this blow. osg::Geode* textGeode = new osg::Geode(); osgText::Text* textLabel = new osgText::Text(); root-addChild(textGeode); // root is a point of osg::group() then, i want to display the numbers being continuelly increasing. the screen I guess will be showen up like this. 0, 1, 2, 3, 4, 5.. In order to achieve this, I typed code within while roop. wchar_t strTmp[100]; swprintf(strTmp, L%.3d, 0); textLabel-setText(strTmp); int index = 0 ; while(!viewer.done()) { swprintf(strTmp, L%d, ++nIndex); textLabel-update(); viewer.frame(); } However, the result is stopped. I think the problem is related to textLabel-update() line. Please, anyone tell me how to change (or update) the text frequently? Thank you! Cheers, Eungil -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50600#50600 ___ 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
Re: [osg-users] How to change the text with osg::Text?
call textLabel-setText(strTmp); instead of update() Also, you may need to set the dataVariance on the osgText to Dynamic. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org