Closed zcwbnu closed 5 years ago
I found that if I use "osg::Node* node = MapNodeHelper().load(arguments, &viewer)" the featurenode can display on earth. What's the difference between osgDB::ReadNodefile and MapNodeHelper().load?
Don't forget to call GLUtils::setGlobalDefaults(stateset); Preferable on your camera's stateset.
@gwaldron Thank you! It works.
I use osgDB::ReadNodefile read a earthfile and added the MapNode to root node,then I created a new featurenode and added it to the root node, however the featurenode is not shown on the earth. I think this is very unbelievable because it is OK in osgearth2.5. Why it don't work well in osgearth2.10? This is my code: osg::Node node = osgDB::ReadNodefile("test.earth"); MapNode mapNode = MapNode::findMapNode(node); root->addChild( mapNode );
Geometry* geom = new Polygon(); geom->push_back( osg::Vec3d(0, 40, 0) ); geom->push_back( osg::Vec3d(-60, 40, 0) ); geom->push_back( osg::Vec3d(-60, 60, 0) ); geom->push_back( osg::Vec3d(0, 60, 0) );