查看: 1174|回复: 0

关于PagedLOD加载倾斜模型的问题

[复制链接]

该用户从未签到

发表于 2022-6-10 22:48:44 | 显示全部楼层 |阅读模式
我使用PagedLOD加载倾斜模型,出现requests:XXX  一直不变化的情况, 模型也停止动态刷新,但是update:XX 是一直变化的,出现假死状态。

请问各位大佬,这是什么问题。


PS:倾斜模型总体大小4G左右,400多个瓦片。

我利用PagedLOD 把倾斜模型合并为了一个索引文件,代码如下:

QString dir = QFileDialog::getExistingDirectory(this, tr("打开模型所在文件夹(Data)"),"/home");

    if(dir == "") return;

    QDir mdir(dir);
    QFileInfoList folder_list = mdir.entryInfoList(QDir:irs | QDir::NoDotAndDotDot);

    osg::ref_ptr<osg::Group> group = new osg::Group();

    for(int i = 0; i < folder_list.count(); i++)
    {
        QString str = folder_list.at(i).fileName();
        QString fpath = folder_list.at(i).absoluteFilePath() + "/" + str + ".osgb";

        osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(fpath.toStdString());
        //! PagedLOD
        osg::ref_ptr<osg:agedLOD> lod = new osg::PagedLOD();
        osg::BoundingSphere bs = node->getBound();
        osg::Vec3 c = bs.center();
        float r = bs.radius();
        lod->setCenter(c);
        lod->setRadius(r);
        lod->setRangeMode(osg:OD::PIXEL_SIZE_ON_SCREEN);

        QString relativeFilePath = "./" + str + "/" + str + ".osgb";
        lod->setFileName(0, relativeFilePath.toStdString());

        lod->setRange(0, 0.0, FLT_MAX);
        

        lod->setDatabasePath("");
        //!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


        group->addChild(lod);
    }

    QString outputLodFile = dir + "/Data.osgb";
    osgDB::writeNodeFile(*group, outputLodFile.toStdString());


Image 2.bmp
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表