[osg-users] Bug in osg text in certain circonstance

Cedric Pinson mornifle at plopbyte.net
Sat Sep 6 03:53:37 PDT 2008


Oops sorry, i fixed the permission.


Robert Osfield wrote:
> Hi Cedric,
>
> I get an "403 Forbidden" error on accessing your file:
>
>     http://www.plopbyte.net/tmp/osgText.ogg
>
> Robert.
>
> On Fri, Sep 5, 2008 at 11:33 PM, Cedric Pinson <mornifle at plopbyte.net> wrote:
>   
>> Hi guys,
>> Strange bug with osgText, with the current configuration:
>>
>>   std::string fontName = "../data/Vera.ttf";
>>   VarsEditor::instance()->get("fontPlayerName", fontName);
>>   osgText::Font* font = osgText::readFontFile(fontName.c_str());
>>   _seatNumber->setFont(font);
>>   _seatNumber->setCharacterSize(25);
>>   _seatNumber->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
>>   _seatNumber->setAlignment(osgText::Text::CENTER_CENTER);
>>   _seatNumber->setFontResolution(30,30);
>>   _seatNumber->setAxisAlignment(osgText::Text::SCREEN);
>>   std::stringstream ss;
>>   ss << "Seat " << data._seatNumber;
>>   _seatNumber->setText(ss.str());
>>
>> I added a video because i don't how to explain it. A text should be display
>> and it is not, it's a bit random, sometimes it works
>> sometime it does not. I dump the osg tree and the osgText was in the file,
>> then if i re read the file with osgviewer it works.
>> I found a trick to make it display again in my application, moving the
>> camera very near, then it appears. I don't have any idea appart accusing
>> osgText.
>> I tried in SingleThreaded and the problem and it does not change.
>> I guess it's related to the camera position when i create the text. Because
>> i susupect that, i tried a configuration
>>
>>  std::string fontName = "../data/Vera.ttf";
>>   VarsEditor::instance()->get("fontPlayerName", fontName);
>>   osgText::Font* font = osgText::readFontFile(fontName.c_str());
>>   _seatNumber->setFont(font);
>>   _seatNumber->setCharacterSize(0.25);
>> //    _seatNumber->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
>>   _seatNumber->setAlignment(osgText::Text::CENTER_CENTER);
>>   _seatNumber->setFontResolution(30,30);
>>   _seatNumber->setAxisAlignment(osgText::Text::SCREEN);
>>   std::stringstream ss;
>>   ss << "Seat " << data._seatNumber;
>>   _seatNumber->setText(ss.str());
>>
>> So the character size mode is now the default, and with that i cant
>> reproduce the bug. So last information i have is when i create the text the
>> text is behind the camera
>> so maybe it does not help for the
>> _seatNumber->setCharacterSizeMode(osgText::Text::SCREEN_COORDS) mode.
>>
>> here the video http://www.plopbyte.net/tmp/osgText.ogg
>>
>> --
>> +33 (0) 6 63 20 03 56  Cedric Pinson mailto:mornifle at plopbyte.net
>> http://www.plopbyte.net
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>     
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>   

-- 
+33 (0) 6 63 20 03 56  Cedric Pinson mailto:mornifle at plopbyte.net http://www.plopbyte.net





More information about the osg-users mailing list