[eq-dev] how to load osgearth file(*.earth) in osgscaleviewer?

49 views
Skip to first unread message

lantian318

unread,
Aug 15, 2014, 12:48:19 AM8/15/14
to eq-...@equalizergraphics.com
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
eq-...@equalizergraphics.com
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com

lantian318

unread,
Aug 15, 2014, 12:51:23 AM8/15/14
to eq-...@equalizergraphics.com
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.
code here.part of node.cpp


it run normally. But i can't find the earth model in window.
<http://software.1713.n2.nabble.com/file/n7586129/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-tp7586129.html

Robert Hauck

unread,
Oct 10, 2014, 8:29:36 AM10/10/14
to eq-...@equalizergraphics.com
Hi

I don't know it it is still open, if yes:

- Do you use just the osgScaleViewer and added those lines?
-> If yes, I suggest to have a look at eqEarth for example,
https://github.com/dardok/eqEarth.

- An error message would be useful....

- as it should load world.tif, those are geo-referenced files, so do you
have and use GDAL etc.?

Cheers,
Robert



--
View this message in context: http://software.1713.n2.nabble.com/how-to-load-osgearth-file-earth-in-osgscaleviewer-tp7586129p7586384.html
Reply all
Reply to author
Forward
0 new messages