|
发表于 2013-9-30 15:41:55
|
显示全部楼层
这是我的代码:
osgEarth::Style geomStyle;
geomStyle.getOrCreate<osgEarth:ineSymbol>()->stroke()->color() = Color::Red; //轮廓线颜色
geomStyle.getOrCreate<osgEarth::LineSymbol>()->tessellation() =50;
geomStyle.getOrCreate<osgEarth::LineSymbol>()->stroke()->width() = 3.0f; //轮廓线宽度
geomStyle.getOrCreate<osgEarth::Symbology:olygonSymbol>()->fill()->color() = Color(Color::Green,0.6);//填充颜色
geomStyle.getOrCreate<osgEarth::AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_RELATIVE_TO_TERRAIN;
geomStyle.getOrCreate<osgEarth::AltitudeSymbol>()->technique() =osgEarth::AltitudeSymbol::TECHNIQUE_DRAPE;
geomStyle.getOrCreate<osgEarth::AltitudeSymbol>()->binding() = osgEarth::AltitudeSymbol::BINDING_VERTEX;
osgEarth::Annotation::FeatureNode* gnode = new osgEarth::Annotation::FeatureNode(mapNode, new osgEarth::Features::Feature(geom, geoSRS, geomStyle));
这里只是初始化一个style,你要做的就是初始化geom,给它随便加几个点试试效果先,希望对你有帮助如果需要给我留言。 |
|