About Road drawing in osgearth

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

About Road drawing in osgearth

Hi,Iam using the following code and drawing the lines in osg and clamping the lines to the terrain for the purpose of road drawing

        LineSymbol* line = style.getOrCreate<LineSymbol>();
        line->stroke()->color() = Color(Color::Black, 0.5f);
        line->stroke()->width() = 8.0f;
        line->tessellationSize() = 5;
        line->stroke()->widthUnits() = Units::METERS;

       AltitudeSymbol* alt = style.getOrCreate<AltitudeSymbol>();
        alt->clamping() = alt->CLAMP_TO_TERRAIN;

How to add texture to those lines or how to add quad to the terrain  for drawing the road in osgearth ?

Thanks & Regards,
R.Rambabu
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About Road drawing in osgearth

Rambabu,
You can add a texture with the LineSymbol::imageURI property.
Glenn Waldron / Pelican Mapping
Rambabu Rambabu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About Road drawing in osgearth

Hi Glenn Waldron thanks for the reply and iam having another problem which is stated below

        LineSymbol* line = style.getOrCreate<LineSymbol>();
        line->stroke()->color() = Color(Color::Black, 0.5f);
        line->stroke()->width() = 8.0f;
        line->tessellationSize() = 5;
        line->stroke()->widthUnits() = Units::METERS;
        line->imageURI() = "D:/Images/roadPic.jpg";
This way iam Setting the image but the image is not adding to the lines(no error but image not adding to the lines) ,How to solve this ?


Thanks,
R.Rambabu
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About Road drawing in osgearth

Not sure. Are you using the master branch of osgEarth?
Glenn Waldron / Pelican Mapping
Rambabu Rambabu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About Road drawing in osgearth

Hi Glenn thanks for the reply and Initially Iam using osgearth 2.8 in that there is no ImageURI functionality and then i started searching for advanced version then i got the osgearth advanced version source code,By using the source code i builded the libraries using cmake.But problem in imagelayer and model layer are effecting my code.I stated my code below

ImageLayer* layer = new ImageLayer("SRTM", gdal);  //error image layer has no constructors
        map->addImageLayer(layer);

map->addModelLayer(new ModelLayer("buildings", fgm_opt)); //error model layer has no constructors

compiler options is not a member of osgEarth::Drivers::featuregeommodeloptions;

Those errors i got if i use advanced source code of osgearth,How should i solve this ?


Thanks & Regards,
R.Rambabu

 
Rambabu Rambabu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About Road drawing in osgearth

Hi Glenn I solved my problem and one doubt as of know buildings are loading on the terrain in compile time,But How to load the buildings in run time i.e  buildings,trees,roads should show on the screen size part only remaining part where buildings,trees,road drawing should not draw,How to do this ?





Thanks & Regards,
R.Rambabu
Loading...