|
发表于 2013-9-30 16:59:31
|
显示全部楼层
本帖最后由 就是那个胖子 于 2013-9-30 17:02 编辑
BOOL CCustomOSGWnd::InitSkyScense(MapNode* pMapNode, osgViewer::Viewer* pViewer)
{
const Config& externals = pMapNode->externalConfig();
const Config& skyConf = externals.child("sky");
double hours = skyConf.value( "hours", 12.0 );
SkyNode* sky = new SkyNode( pMapNode->getMap() );
float ambientBrightness = 5.0f; //设置大气环境亮度,值越大亮度越高
sky->setMoonVisible(false);//设置月亮是否可见
sky->setAmbientBrightness( ambientBrightness );
sky->setDateTime( 2011, 3, 6, hours );
sky->attach( pViewer );
osg::Group* root = new osg::Group();
root = pMapNode;
root->addChild( sky );
return TRUE;
}
我是这么实现的,你可以参考下,不知道是不是你说的要求 |
|