[osg-users] Problems with osgText::Text internal transformations and LineSegmentIntersector

Robert Osfield robert.osfield at gmail.com
Tue Mar 20 07:28:21 PDT 2018


Hi Brian,

I checked into some fixes to osgText to improve the bounding box
calculations, these will have been after 3.5.6. Could you try the
OpenSceneGraph-3.6 branch as this is will be the source of the up
coming 3.6.0 stable release and contains lots of fixes since 3.5.6.

FYI, the whole 3.5.x series are developer releases that were building
up to the 3.6 branch that I made this morning, developer releases are
just snapshots of the development work, they are supported releases
like the stable releases.

Cheers,
Robert.

On 20 March 2018 at 10:46, Brian Hutchison <bhutchison at systra.com> wrote:
> Hi,
>
> When I use any of the following methods to reposition osgText::Text the picking fails when used with LineSegmentIntersector.
>
>
> Code:
>
> text->setPosition() // anything other than {0.0,0.0,0.0}
> text->setRotation() // anything other than osg::Quat(0.0, osg::Z_AXIS)
> text->setAlignment() // anything other than LEFT_BOTTOM
>
>
>
>
> As far as I can work out from debugging, the bounds are being correctly calculated and "intersectAndClip" is returning true.  The problem seems to be when "drawable->accept" is called in the "intersect" method, the IntersectFunctor does not have the transformations that Text is using and the vertices passed to it are not transformed.
>
> The only way I can find around this is to place the text inside PositionAttitudeTransform's and do the positioning myself.  Unfortunately, since I do not know the eventual dimensions of the text, doing a CENTER_CENTER alignment is practically impossible.
>
> If I leave the alignment to be done by Text then a CENTER_CENTER alignment means that you can only pick the top left quarter of the text.
>
> I have tried placing the text inside either a Geode or a Group but it makes no difference.
>
> I would be very happy if I was simply not calling something I should be to initalise the Text or its container correctly.
>
> We are using OSG 3.5.6 statically linked via VCPKG.
>
> Any help gratefully received,
>
> Thanks,
>
> Brian[/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=73137#73137
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list