ModelNode and Terrain Vertical Scale

classic Classic list List threaded Threaded
2 messages Options
Geoff Geoff
Reply | Threaded
Open this post in threaded view
|

ModelNode and Terrain Vertical Scale

Hello, is it possible to clamp ModelNodes to terrain that has been exaggerated via VerticalScale?  My ModelNodes clamp fine to unscaled terrain, but if the terrain gets scaled, it changes as expected while the ModelNodes don't move at all.  I've tried modifying the verticalScale attribute of the nodes but it doesn't seem to have any effect.  Other posts about this issue suggest that annotations aren't compatible with the VerticalScale terrain effect, but those are from almost 10 years ago, so I'm hoping that's no longer the case.  Is there a trick to getting ModelNodes to adjust when terrain vertical scale changes?

For reference, here's the style I'm using for my ModelNodes.

style.getOrCreate<ModelSymbol>()->setModel(myModel);
style.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
style.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU;
style.getOrCreate<AltitudeSymbol>()->verticalScale() = 1.0;

Thanks

[ osg 3.4.0, osgEarth 2.8.0, Intel HD Graphics 530 ]
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: ModelNode and Terrain Vertical Scale

Geoff,
osgEarth 2.8 is old, but iirc the VerticalScale is just a shader trick. Nothing on the CPU side is aware of it. One of the reasons it was deprecated in later versions.
Glenn Waldron / Pelican Mapping