hello,

i have a problem!
i try to load a osgearth file in osgscaleviewer. 
i add some code in class node. it load the osgearth model file in configInit
function.

   bool Node::configInit( const eq::uint128_t& initID )
    {
        if( !eq::Node::configInit( initID ))
            return false;

        Config* config = static_cast<Config*>( getConfig( ));
        if( !isApplicationNode() && !config->loadInitData( initID ))
            return false;

        _frameStamp = new osg::FrameStamp;
        _updateVisitor = new osgUtil::UpdateVisitor;
        _updateVisitor->setFrameStamp( _frameStamp );
        _contextID = 0;
#ifdef LOADEARTH
        /* BEGIN: Added by frankz, 2014/8/14   PN:1 */
        // load mode here
        osg::Node* osg_node = 0L;
        char** filename = new char *[10];
        filename[0] =
"D:\\code\\osgearth-osgearth-2.5\\osgearth-osgearth-2.5\\tests\\feature_geom.earth";
        int itemp = 1;
        osg::ArgumentParser arguments(&itemp,filename);
                LBINFO << "earth file" << arguments[0];

        osg_node = osgDB::readNodeFile( arguments[0] );

        if( !osg_node )
        {
            LBINFO << "No earth file" ;
            LBERROR << "Load earth file failed";
        }
        osg::ref_ptr<MapNode> mapNode = MapNode::get(osg_node);
        if ( !mapNode.valid() )
        {
            LBINFO << "Loaded scene graph does not contain a MapNode -
aborting" ;
            return false;
        }

        //root node to hold everything:
        osg::ref_ptr< osg::Group > root = new osg::Group();
//        osg::Group* root = new osg::Group();
        root->addChild( mapNode.get() );
        _model = root;
                return true;
        /* END:   Added by frankz, 2014/8/14   PN:1 */

#else


it run normally. But i can't find the earth model in window.
<http://software.1713.n2.nabble.com/file/n7586128/20140815_001.jpg> 
What causes it?

Thanks!



--
View this message in context: 
http://software.1713.n2.nabble.com/how-to-load-osgearth-file-earth-in-osgscaleviewer-tp7586128.html
Sent from the Equalizer - Parallel Rendering mailing list archive at Nabble.com.

_______________________________________________
eq-dev mailing list
[email protected]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com

Reply via email to