Elevation layer

classic Classic list List threaded Threaded
8 messages Options
JD JD
Reply | Threaded
Open this post in threaded view
|

Elevation layer

Hi community!

I use an elevation layer with <elevation/> in an earth file so that i can use the SDK method "oe_terrain_getElevation" for a specific purpose.
But i don't want the terrain to be extruted according to the elevation (I want it always at the 0 altitude).
How can i achieve this?

Thanks,
Jérôme.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Elevation layer

Jérôme,

You can disable this using a define on a StateSet in your code.

For a specific layer:

layer->getOrCreateStateSet()->setDefine(
    "OE_TERRAIN_RENDER_ELEVATION",
    osg::StateAttribute::OFF);

For the whole map, you need an override:

mapNode->getOrCreateStateSet()->setDefine(
    "OE_TERRAIN_RENDER_ELEVATION",
    osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE);

Hope this helps.
Glenn Waldron / Pelican Mapping
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: Elevation layer

Thank you!

It seems it is only for REX engine. Is there something similar for MP?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Elevation layer

No.
Glenn Waldron / Pelican Mapping
beyond beyond
Reply | Threaded
Open this post in threaded view
|

Re: Elevation layer

In reply to this post by gwaldron
hi,I used this method, but the results were not very good.When I zoom in at high altitude area:

beyond beyond
Reply | Threaded
Open this post in threaded view
|

Re: Elevation layer

beyond wrote
hi,I used this method, but the results were not very good.When I zoom in at high altitude area:

hi,anyone have any ideas?thanks.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Elevation layer

In reply to this post by beyond
What are we looking at?
Can you post an earth file?
Please provide details.
Glenn Waldron / Pelican Mapping
beyond beyond
Reply | Threaded
Open this post in threaded view
|

Re: Elevation layer

I need to use the SDK method "oe_terrain_getElevation" for for a specific purpose so I need to add elevationLayer,but i don't want the terrain to be extruted according to the elevation (I want it always at the 0 altitude).

So I call "mapNode->getOrCreateStateSet()->setDefine( "OE_TERRAIN_RENDER_ELEVATION", osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE)",but that didn't work.

When I zoom the camera,it still enter the terrain. I want the surface of the earth to be smooth rather than 3D terrain effect.