|
楼主 |
发表于 2008-6-28 19:54:09
|
显示全部楼层
回复 2楼 的帖子
[code]
osg::Node* createEarth()
{
osg::TessellationHints* hints = new osg::TessellationHints;
hints->setDetailRatio(5.0f);
osg::ShapeDrawable* sd = new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0,0.0,0.0), osg::WGS_84_RADIUS_POLAR), hints);
osg::Geode* geode = new osg::Geode;
geode->addDrawable(sd);
std::string filename = osgDB::findDataFile("Images/land_shallow_topo_2048.jpg");
geode->getOrCreateStateSet()->setTextureAttributeAndModes(0, new osg::Texture2D(osgDB::readImageFile(filename)));
osg::CoordinateSystemNode* csn = new osg::CoordinateSystemNode;
csn->setEllipsoidModel(new osg::EllipsoidModel());
csn->addChild(geode);
return csn;
}
[/code]
我只把这段从别的例子里面拿过来的,代码放到mfc的例子里面,出来的球是扁的,跟我mfc窗口有关系。 |
|