|
楼主 |
发表于 2011-3-4 12:01:11
|
显示全部楼层
感谢array的及时回复。我把代码贴上来,您看看
for(..................)
{
osg:agedLOD* pPage= new osg::PagedLOD();
pPage->setCenterMode( osg::PagedLOD::USER_DEFINED_CENTER );
pPage->setCenter(osg::Vec3(X,Y,Z));
pPage->setRadius(radius);
//粗模作为第二级LOD,其名称规则为加上LOD2
std::string coarseFileName = (std::string)szFilePath + "data\\LOD\\LOD2\\"+ filename;
//设置两级LOD
/*pPage->setFileName(0,fileName);*/
osg::ref_ptr<osg::Node> model = osgDB::readNodeFile(coarseFileName, options.get());
pPage->addChild(model,1500,FLT_MAX);
pPage->setFileName(1,fileFullName);
pPage->setRange(1,0.0, 1500);
rootNode->addChild(pPage);
}
rootNode->getOrCreateStateSet()->setAttributeAndModes( new osg::CullFace(osg::CullFace::BACK) );
还有就是我的模型中个别模型很大,osg文件就有三百多兆,我纳闷的是为什么加了雾效,还是那么多顶点要渲染。 |
|