I have to draw paths on a globe and want them to "respect" the Z/Altitude values as relative to the earth ellipsoid.
Say I make a straight path from, e.g., NY to Tokio, with some points in between to change the altitude. I wanted the line to make a smooth curve around the earth, with correct distance from ellipsoid. If any part of said path had a Z level of 0, it would be drawn properly on the terrain without going through the earth ellipsoid.
Using annotations, my code is something like this:
osgEarth::Annotation::Geometry* path = new osgEarth::Annotation::LineString();
for(LatLonAlt lla : latLonAltVector) // <- this is a vector of a p.o.d. struct
path->push_back(lla.lon, lla.lat, lla.alt);
osgEarth::Features::Feature* pathFeature = new osgEarth::Features::Feature(path, srs);
pathFeature->geoInterp() = osgEarth::GeoInterpolation::GEOINTERP_GREAT_CIRCLE;
I think I need to set the correct clamping, but my issue is that I don't know which clamping to use. Reading the Clamping enum comments sounds like I need to use CLAMP_ABSOLUTE, but the line goes through the earth when using anything other than CLAMP_TO_TERRAIN.
Is there some sort of configuration needed to use CLAMP_ABSOLUTE so that it draws the entire line at a certain fixed altitude? Do I have to manually break the line into small steps to avoid said issue?