Child of Geotransform incorrectly renders

classic Classic list List threaded Threaded
4 messages Options
Blanky Blanky
Reply | Threaded
Open this post in threaded view
|

Child of Geotransform incorrectly renders

Hi,

I'm trying to draw an osgEarth::Geometry around a model, however I'd like to tightly couple the group together such that if I call setPosition on the GeoTransform, the model and Geometry move together.

However, the model I am creating from an .osgb file is correctly placed but the osgEarth::Geometry is not. My hierarchy is as follows:

    GeoTransform holds
    AutoTransform.
    AutoTransform holds the geode of
    the model.

    The GeoTransform also now holds
    a osgEarth::Geometry at the same
    level as the AutoTransform.

What occurs is the following:
    The models are located correctly,
    both in a projected SRS and the
    Geodetic SRS. The
    osgEarth::Geometry is located
    correctly in a projected SRS, but
    not in a Geodetic SRS.

Shouldn't the osgEarth::Geometry added as a child to the GeoTransform adopt its positional values if we set the osgEarth::Geometry's position to (0,0,0)?

In Geodetic space the osgEarth::Geometries appear to be way in outer space, in a strange orientation, but completely fine in the projected map.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Child of Geotransform incorrectly renders

Blanky,

An osg::Geometry directly under a GeoTransform will have it's local origin at the location of the GeoTransform. This works correctly - see (or edit) the osgearth_transform.cpp example.

(I assume you mean osg::Geometry, since there is no "osgEarth::Geometry" class that you can add to a scene graph.).
Glenn Waldron / Pelican Mapping
Blanky Blanky
Reply | Threaded
Open this post in threaded view
|

Re: Child of Geotransform incorrectly renders

Hey Glenn,

I meant to say I created a Feature using the osgEarth::Geometry::Ring specifically and then using that Feature I created a FeatureNode that was ultimately added to the GeoTransform. This Feature renders at the wrong location,  but I will take a look at that example in the meantime. Thanks!

- Blanky
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Child of Geotransform incorrectly renders

Blanky,

A FeatureNode renders one or more GIS Features, which are geographic objects with absolute map coordinates. It doesn't make sense to put it under a GeoTransform.
Glenn Waldron / Pelican Mapping