ting zhang
2010-08-11 02:25:14 UTC
Hi,
I write a map.earth file according to the original examples of .earth files in osgEarth project. The map.earth file is as follows:
<map name="tkm" type="projected">
<heightfield name="terrain-dem" driver="vpb">
<url> C:\Test.ive </url>
</heightfield>
</map>
where “Test.ive” file is generated by VPB0.9.10 and it’s a terrain file using Gaussian projected coordinate system.. Therefore, the type in .earth file is "projected".
Then in my win32 console program, I read the map.earth in my project, the codes are as follows:
// header files …
……
int _tmain(int argc, _TCHAR* argv[])
{
int num =1;
char* path = "D:/maps.earth";
osg::ArgumentParser arguments(&num,&path);
osgViewer::Viewer viewer(arguments);
osg::ref_ptr<osg::Node> Test_node = osgDB::readNodeFile(“D:/maps.earth”);
viewer.setSceneData(Test_node.get());
viewer.realize();
std::cout<<path<<std::endl;
viewer.run();
return 0;
}
The compilation is correct. When debugging the code, I find the Test_node point is not empty. However, the ive terrain file is not shown in the whole scene. In the whole scene, there is nothing but the blue background. I use cow.osg to replace Test.ive for tests. However, I cannot find the cow, either.
I wonder what is going on with my osgEarth, are there some problems with my coordinate setting or something else? Plus, all the osgEarth dll libraries have been put in the environmental path. Thank you.
Thank you!
Cheers,
ting
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30683#30683
I write a map.earth file according to the original examples of .earth files in osgEarth project. The map.earth file is as follows:
<map name="tkm" type="projected">
<heightfield name="terrain-dem" driver="vpb">
<url> C:\Test.ive </url>
</heightfield>
</map>
where “Test.ive” file is generated by VPB0.9.10 and it’s a terrain file using Gaussian projected coordinate system.. Therefore, the type in .earth file is "projected".
Then in my win32 console program, I read the map.earth in my project, the codes are as follows:
// header files …
……
int _tmain(int argc, _TCHAR* argv[])
{
int num =1;
char* path = "D:/maps.earth";
osg::ArgumentParser arguments(&num,&path);
osgViewer::Viewer viewer(arguments);
osg::ref_ptr<osg::Node> Test_node = osgDB::readNodeFile(“D:/maps.earth”);
viewer.setSceneData(Test_node.get());
viewer.realize();
std::cout<<path<<std::endl;
viewer.run();
return 0;
}
The compilation is correct. When debugging the code, I find the Test_node point is not empty. However, the ive terrain file is not shown in the whole scene. In the whole scene, there is nothing but the blue background. I use cow.osg to replace Test.ive for tests. However, I cannot find the cow, either.
I wonder what is going on with my osgEarth, are there some problems with my coordinate setting or something else? Plus, all the osgEarth dll libraries have been put in the environmental path. Thank you.
Thank you!
Cheers,
ting
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30683#30683