osg开发配置与第一个osg程序-CSDN博客
#include <osg/Geode>
#include <osg/ShapeDrawable>
#include <osgViewer/Viewer>
#include <iostream>
int main(int argc, char** argv)
{
std::cout << "Hello, osg!" << std::endl;
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
viewer->setUpViewInWindow(50, 50, 800, 600);
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(), 1.0f)));
viewer->setSceneData(geode);
return viewer->run();
}