|
const osgEarth::SpatialReference* latLong = osgEarth::SpatialReference::get("wgs84");
osgEarth::GeoPoint gpt(latLong, 110, 34, 0);
osg::Image* city = osgDB::readImageFile("../../icons/city.png");
osgEarth::Style style;
style.getOrCreateSymbol<osgEarth::Symbology::TextSymbol>();
osgEarth::Annotation:laceNode* pn = new osgEarth::Annotation::PlaceNode(NULL, gpt, city, "China", style);
// 下面两种方式写ive都出错
osgDB::Registry::instance()->writeNode(*pn, "F:/testChina.ive", osgDB::Registry::instance()->getOptions());
//osgDB::writeNodeFile(*pn, "F:/testLod.ive", osgDB::Registry::instance()->getOptions());
其中city.png就是个图片。
无论我使用哪种方式都无法正确将osgEarth::Annotation::PlaceNode节点输出到ive文件,错误是:Error writing IVE image: StateSet::write(): Unknown StateAttribute: VirtualProgram |
|