Quantcast

LineString doesn't clamp on models

classic Classic list List threaded Threaded
7 messages Options
code_earth code_earth
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

LineString doesn't clamp on models

I am creating a LineString, by picking points on intersetion.

_osgEarthGeomtry = new osgEarth::Symbology::LineString();

and creating the feature using this geometry
_osgEarthFeature = new osgEarth::Features::Feature(_osgEarthGeomtry.get(), spacialReferenceOfMapNode, geomStyle);

when I apply the following Altitude Symbol(to the geomstyle), It doesn't change geometry of line

geomStyle.getOrCreate<osgEarth::Symbology::AltitudeSymbol>()->clamping() = osgEarth::Symbology::AltitudeSymbol::CLAMP_ABSOLUTE;
        geomStyle.getOrCreate<osgEarth::Symbology::AltitudeSymbol>()->technique() = osgEarth::Symbology::AltitudeSymbol::TECHNIQUE_GPU;




However when I use clamping to terrain, It doesn't consider the modelSymbols(which are added to same mapnode)

geomStyle.getOrCreate<osgEarth::Symbology::AltitudeSymbol>()->clamping() = osgEarth::Symbology::AltitudeSymbol::CLAMP_TO_TERRAIN;
        geomStyle.getOrCreate<osgEarth::Symbology::AltitudeSymbol>()->technique() = osgEarth::Symbology::AltitudeSymbol::TECHNIQUE_GPU;



I want Line geometry to clamp on the underlying Geometry(modelSymbols as well).
Is it feasible? Please help.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LineString doesn't clamp on models

CLAMP_ABSOLUTE + TECHNIQUE_GPU has no meaning, so it won't do anything.

It's not possible to use GPU clamping with models; it only supports terrain clamping.
Glenn Waldron / Pelican Mapping
code_earth code_earth
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LineString doesn't clamp on models

So which clamping technique supports models? Please guide.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LineString doesn't clamp on models

None; they are for terrain clamping.

The only exception is for so-called "site models" where you have a pre-modeled terrain area and want to insert it into the osgEarth terrain. In that case you can use a ModelLayer and set patch="true". That will cause geometry using the default TECHNIQUE_MAP clamping type to also clamp to those model layers.

Glenn Waldron / Pelican Mapping
code_earth code_earth
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LineString doesn't clamp on models



Thank you gwaldron.
code_earth code_earth
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LineString doesn't clamp on models

Hi gwaldron,

will It be possible to draw line inside building models ? Lets say we have points marked inside buildings, and we use them to create line string.

I have been able to achieve this using CLAMP_ABSOLUTE. But I am looking for line clamping, where line geometry deforms as per building geometry.

could you please throw some hints on how to achieve it ?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LineString doesn't clamp on models

The GeometryClamper class might be able to help if you set your model as the terrain patch. I've never tried this though.
Loading...