Put a PNG inside a CircleNode

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

Put a PNG inside a CircleNode

Hi,

I need to create a circle below a Node, then I can do it.

osgEarth::Symbology::Style shapeStyle;
shapeStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::White, 0.5);
        const SpatialReference* geoSRS = s_mapNode->getMapSRS()->getGeographicSRS();
        CircleNode* circle = new CircleNode();

        circle->set(
                GeoPoint(geoSRS, point.x(), point.y(), 4, ALTMODE_RELATIVE),
                16,
                shapeStyle,
                Angle(360, Units::DEGREES),
                Angle(360, Units::DEGREES),
                true);
s_mapNode->addChild(circle);

But my problem is to insert a png file inside the circle, like a texture.

I don't know if my approch it's correct.

NOTE:
I tried to pass to the Style the png using the IconSymbol, but in this case the png is not applied on the circle.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Put a PNG inside a CircleNode

Marco,
Texturing a geometry like that is not a feature that osgEarth supports. You will need to implement that yourself.
 
Glenn Waldron / Pelican Mapping