Hi Jason,

2.x is generally more consistent w.r.t use of doubles internally so
will tend to suffer less from precision issues.  However, without
testing you exact setup I can't say whether these general improvements
will help with this specific problem you have.

W.r.t. porting from OSG-1.x to OSG-2.x, it might not actually be as
bad as you feel, in you are using osgUtil::SceneView you'll find the
majority of the OSG will just recompile with no changes.   There is a
few changes in API that might catch you out, but substantially the OSG
is still the same scene graph.

The biggest change between OSG-1.x and OSG-2.x is the osgProducer
replaced by osgViewer  and the new CMake build system, since you don't
use osgProducer then the build system is the biggest change.  It is
however, a big improvement in terms of cross platform support, so
while a bit of learning curve is well worth it.

Robert.

On Tue, Mar 18, 2008 at 3:54 PM, Jason Beverage <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've written a 2D viewer that displays geospatial imagery in an orthographic
> projection using a WGS-1984 geodetic projection so the units are in degrees.
>
> I am placing text labels with their character size specified in
> SCREEN_COORDS.  When I zoom in very close, the quality of the text starts to
> suffer b/c the glyph quads are so small that they are losing precision when
> rendering.  Placing a MatrixTransform above the text to position it locally
> reduces the visual problems but there are still some present.
>
> The main problem I have is that the text cannot be selected if I zoom in
> close.  I can see the text fine, but clicking on it doesn't result in a hit
> b/c the intersections are all done using floats and the text glyphs are
> extermely small because of the autosizing.
>
> I found a potential solution using the latest version of OpenSceneGraph
> which places the text in an orthographic HUD camera and positions it at the
> correct space on the earth using the callback at the end of this email.
> Intersections work well and the text looks very crisp.
>
> We are currently using OpenSceneGraph 1.2 and are rolling our own viewer
> using SceneView and IntersectVisitor (NOT IntersectionVisitor) in our
> application and cannot update this spiral due to time constraints.
> IntersectVisitor does not seem to work correctly in picking items placed in
> a CameraNode in the 1.2 version.
>
> Does anyone have any suggestions on how I could fix this issue using
> OpenSceneGraph 1.2 and does the solution I found for using the latest
> version of OSG make sense or I am missing something painfully obvious?
>
>  Thanks!
>
> Jason
>
> struct HudTextUpdateCallback : public osg::Drawable::UpdateCallback
> {
> public:
>   HudTextUpdateCallback(double lon, double lat, Viewer* viewer)
>   {
>     _viewer = viewer;
>     _lon = lon;
>      _lat = lat;
>   }
>
>   virtual void update(osg::NodeVisitor* nv, osg::Drawable* drawable)
>   {
>     Text* text = dynamic_cast<Text*>(drawable);
>     if (text)
>     {
>       CameraHelper h;
>       h.setCamera(_viewer->getCamera());
>
>       osg::Vec3 object(_lon,0,_lat);
>       osg::Vec3 window;
>
>       h.projectObjectIntoWindow(object, window);
>       text->setPosition(osg::Vec3(window.x(), window.y(), 0.0));
>     }
>   }
>
>   double _lon;
>    double _lat;
>   Viewer *_viewer;
> };
>
> _______________________________________________
>  osg-users mailing list
>  [email protected]
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to