On 8/16/06, E. Wing <[EMAIL PROTECTED]> wrote:
The work-around of disabling this code would probably not be good
because I use the bounding box to help with layout so I don't overlap
text by accident. Having inaccurate bounding boxes that are too small
will be problematic.
So, I looked into this and found that my bounding box computations
were done too often. I misinterpreted when the bounding box (thought
it went with every computePositions() call but it happens that
computePositions() can be called when the bounding box doesn't need to
be recomputed. Since my bounding box computations adjust themselves
based on previous value assumed to be the non-backdrop bounding box
size, the bounding box kept accumulating bad values until the text
string was changed (forcing a complete reset).
I have refactored the code so the bounding box is computed at only the
right times (I hope). I added a couple of protected non-virtual
methods to help with the refactoring. I was trying not to break binary
compatibility with 1.1 (I hope I succeeded). Unfortunately, I lack a
good document on what I can do or what not to do. (I would a
appreciate a link to a good document on this.)
I also discovered an area of potential optimization within my backdrop
enhancements. There is a function that computes the average width and
height for a set of glyphs. It is called once for each contextID, but
I think its values are independent of context. But I couldn't see an
easy and clean way of optimizing this without breaking the ABI. So I
have marked the sections with
// FIXME: OPTIMIZE:
As for the space bar / 'moved far away' problem, the results look the
same to me with the bounding box code enabled or disabled. So I think
this might be a problem that is independent of my bounding box
computations if we're talking about the same thing. SCREEN text gives
me a lot of problems with sizing in general, even before my backdrop
changes. Let me know if this patch fixes the problem you're talking
about or not.
-Eric
> Date: Sat, 5 Aug 2006 18:00:46 +0100
> From: "Robert Osfield" <[EMAIL PROTECTED]>
> Hi Antoine,
>
> I have just applied your suggested change to osgtext and recreate the
> problem. By setting the draw mode to TEXT | OUTLINE, it becomes very
> obvious that the bounding box compute code is wrong for the new
> outline code. I have checked this in so that others can reproduce the
> problem.
>
> I'll let Eric Wing have a chance to respond, as he's the author of the
> outline/backdrop code.
>
> As simple workaround we could problem just comment out the
> contribution to the text BB of the outline, as it in theory shouldn't
> be that significant anyway, and the worst that could happen is to cull
> a text drawable when the text isn't visible, but its outline is.
> Personally I don't think you'll ever notice this.
>
> Robert.
>
> On 8/5/06, Antoine Hue < [EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I am currently testing the new backdrop capability of osgText::Text (I
> > am very interested in this feature). I am applying to text with auto
> > orientation to screen (osgText::Text::SCREEN).
> >
> > On my own design, I when adding backdrop of type osgText::Text::OUTLINE,
> > as soon as I rotate the scene, the texts are fying out of the screen
> upward.
> >
> > While wanting to reproduce the bug on the OSG example/osgtext, I have
> > added outline backdrop to the "SCREEN" text:
> > osgText::Text* text4 = new osgText::Text;
> > text4->setFont("fonts/times.ttf");
> > text4->setCharacterSize(characterSize);
> > text4->setPosition(center);
> > text4->setAxisAlignment(osgText::Text::SCREEN);
> > text4->setBackdropType(osgText::Text::OUTLINE); //
> > ----------------------------------------
> > text4->setText("SCREEN");
> > geode->addDrawable(text4);
> >
> > The text is not flying away but another symptom is appearing: when
> > pressing the space bar (to go to the home position), the group
> > containing the "SCREEN" text is moved far away as if the scene bounding
> > box would be huge.
> >
> > Antoine
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
>
>
> ------------------------------
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
>
> End of osg-users Digest, Vol 23, Issue 7
> ****************************************
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
