OSG入門——繪製地球雲圖

驚鴻雨發表於2014-10-28
</pre><pre>
#include <osg/Group>
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgViewer/api/Win32/GraphicsWindowWin32>
#include <osgEarthAnnotation/RectangleNode>
#include <osgEarthSymbology/Style>
#include <osgEarthSymbology/AltitudeSymbol>

//using namespace osgEarth::Annotation;


#include <iostream>
#ifdef _DEBUG
#pragma comment(lib,"osgDBd.lib");
#pragma comment(lib,"osgViewerd.lib")
#pragma comment(lib,"osgd.lib");
#else
#pragma comment(lib,"osgDB.lib");
#pragma comment(lib,"osgviewer.lib");
#pragma comment(lib,"osg.lib");
#endif

int main()
{
	osg::ref_ptr<osg::Group> root = new osg::Group;
	osgViewer::Viewer myViewer;
	osg::ref_ptr<osg::Node> earth = osgDB::readNodeFile("cloudmade.earth");
	if (!earth.get())  
	{  
		std::cout<<"open file is failed!"<<std::endl;  
		return -1;  
	}  
	root->addChild(earth);
	myViewer.setSceneData(root.get());
	myViewer.realize();  
	myViewer.run();  

}


相關文章