Check that new text code I posted. I initially had problems handling
the space character because it's implemented as having zero height and
width.

First make sure I sent you the right version: fHorizQuadMargin and
fVertQuadMargin initialization should be checking for vDiff nonzero
before dividing. My driver didn't like when I forgot to do that. Also,
the code assumes that the texture width/height are nonzero. If this
assumption is incorrect, the division by zero at that point might be
causing a problem.

Other than that, the only thing I can see a driver tripping up on is
creation of a zero area quad (which a space will end up being) with
different texture coordinates at each vertex. This will give an
infinite rate of change of texture coordinates across the primitive
which might be confusing the driver.

To see if this is the problem, try the following code to avoid adding
unnecessary margins to zero width glyphs.

                    float fHorizTCMargin = 1.0f / glyph->getTexture()-
>getTextureWidth();
                    float fVertTCMargin = 1.0f / glyph->getTexture()-
>getTextureHeight();
                    float fHorizQuadMargin;
                    if (vDiff.x() == 0.0f)
                    {
                        fHorizQuadMargin = 0;
                    }
                    else
                    {
                        fHorizQuadMargin = width * fHorizTCMargin /
vDiff.x();
                        mintc.x() -= fHorizTCMargin;
                        maxtc.x() += fHorizTCMargin;
                    }
                    if (vDiff.y() == 0.0f)
                    {
                        fVertQuadMargin = 0;
                    }
                    else
                    {
                        fVertQuadMargin = height * fVertTCMargin /
vDiff.y();
                        mintc.y() -= fVertTCMargin;
                        maxtc.y() += fVertTCMargin;
                    }

On Mar 11, 10:46 am, Jeremy Moles <[EMAIL PROTECTED]> wrote:
> I tagged a 0.1.6 of osgWidget:
>
>        http://osgwidget.googlecode.com
>
> I really wouldn't even bother posting about it to be honest but I need a
> bit of help if anyone is willing to try it. :)
>
> Upon building osgWidget (you'll want to get the monospace font and the
> osgText.cpp patch for maximum font clarity, but they aren't necessary),
> run the osgwidgetinput example and press the following keys:
>
>         n
>         SPACE
>
> Where that's the actual key 'n' and the spacebar. Something really
> bizarre is happening on my machine and I'm beginning to think it's a
> driver bug... what happens though is that I get an Floating Point
> Exception inside of NVidia's libGL, and it seems to have something to do
> with the "space" character in some context. If you immediately insert a
> space character, you can then follow that with any series of key presses
> you like, including spaces or otherwise.
>
> Anyways, this isn't a big deal (I'm sure I'll get it figured out), but I
> just wanted to let folks know I'm still alive and things are chugging
> along slowly. :)
>
> (I've been extremely busy these last few weeks writing some
> system-auditing software in Python for a client, and haven't had much
> time for hobby code...)
>
> _______________________________________________
> osg-users mailing list
> [EMAIL 
> PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph...
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to