Hi Alessandro,

Comments within.

Thank you very much...you were right...I managed to remove that white cross. Now I have two more questions concerning Text. First, I wonder what is the purpose of a call like this:

pText->setDrawMode(osgText::Text::TEXT);

I tryed to remove such a call and the effect on the displayed text is the same.

The draw mode is set to just TEXT by default so just the text will be rendered. The input to the method is a mask so you can turn the rendering of various objects on or off. In this case the options are TEXT, BOUNDINGBOX and ALIGNMENT to control the rendering of the text, a bounding box around the text, and the alignment cursor respectively. So you could turn on rendering of all three as follows:

pText->setDrawMode(osgText::Text::TEXT & osgText::Text::BOUNDINGBOX & osgText::Text::ALIGNMENT);

My next problem relates to fonts loading. I tryed to load several font files like this:

osg::ref_ptr<osgText::Font>

font = osgText::readFontFile( "arial.ttf" );

pText->setFont(font.get());

but it looks like that readFontFile doesn't manage to find the specified font file even if:

1) I had its path to OSG_FILE_PATH (...which contains spaces...)

2) I move the font file to the same directory of my executable

readFontFile(.) returns always NULL. Why?

I'm not sure why this is returning NULL for you. It could be caused by the freetype plugin not being available for your application. Is your osgdb_freetype.dll (osgdb_freetyped.dll for debug) built and in the path for your application?

HTH,

Mike

Thanks.

Alessandro


On 4/19/07, *Michael Henheffer* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi Alessandro,

    Try setting the draw mode to render only the text.

       pText->setDrawMode(osgText::Text::DrawModeMask::TEXT);

    My guess is that the current draw mode mask also contains ALIGNMENT.

    Mike

    alessandro terenzi wrote:
    >
    > Hi all,
    >
    > I'm getting familiar with osgText::Text objects. It looks like that
    > every object I create is rendered with a white cross in the
    middle of
    > the text itself...I think it represent the point with respect to
    which
    > the text is aligned...how can avoid to render also that white
    cross?
    >
    >
    >
    > Thanks.
    >
    > Alessandro
    >
    >
    ------------------------------------------------------------------------
    >
    > _______________________________________________
    > osg-users mailing list
    > [email protected] <mailto:[email protected]>
    > http://openscenegraph.net/mailman/listinfo/osg-users
    <http://openscenegraph.net/mailman/listinfo/osg-users>
    > http://www.openscenegraph.org/

    --
    CARIS
    115 Waggoners Lane, Fredericton, New Brunswick, Canada, E3B 2L4
    Tel: +1-506-458-8533  Fax: +1-506-459-3849
    _________________________________________________________________________
    New Viewer for 2D and 3D Data
    Download your free copy of CARIS Easy View today!
    www.caris.com/easyview <http://www.caris.com/easyview>
    _________________________________________________________________________

    This email and any files transmitted with it are confidential and
    intended only for the addressee(s). If you are not the intended
    recipient(s) please notify us by email reply. You should not use,
    disclose, distribute or copy this communication if received in error.

    Any views or opinions expressed in this email are solely those of the
    author and do not necessarily represent those of the company. No
    binding
    contract will result from this email until such time as a written
    document is signed on behalf of the company.

    _______________________________________________
    osg-users mailing list
    [email protected] <mailto:[email protected]>
    http://openscenegraph.net/mailman/listinfo/osg-users
    <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/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to