首页 > 其他 > 详细

osg qt fbx

时间:2019-07-13 13:17:27      阅读:101      评论:0      收藏:0      [点我收藏+]

 

void TeslaManage::loadModelFile(QString &filename)
{
    file_node = osgDB::readNodeFile(std::string((const char *)filename.toLocal8Bit()));
    root->addChild(file_node);
    root->addChild(createLight());
    
    viewer->setSceneData(root);
    viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
    //_viewer->setCameraManipulator(new osgGA::TrackballManipulator);
    viewer->addEventHandler(new osgViewer::WindowSizeHandler());

    //添加操作器
    viewer->setCameraManipulator(new osgGA::TrackballManipulator());

    GraphicsWindowQt* gcQT = dynamic_cast<GraphicsWindowQt*>(graphicsContext);
    if (gcQT) {
        pWgt = gcQT->getGLWidget();
        //this->tesla_manage_ui.listWidget.addItem(pWgt);

        //this->tesla_manage_ui.listWidget->addItem(pWgt);
        //this->tesla_manage_ui.openGLWidget = gcQT->getGLWidget();
        //this->tesla_manage_ui.widget = gcQT->getGLWidget();
        //ui.horizontalLayout->addWidget(pWgt);
        //this->tesla_manage_ui.verticalLayout->addWidget(pWgt);
        this->tesla_manage_ui.horizontalLayout_3->addWidget(pWgt);
    }

    connect(_timer, SIGNAL(timeout()), this, SLOT(slotTimeUpdate()));
    _timer->start(5);
}

技术分享图片

 

osg qt fbx

原文:https://www.cnblogs.com/herd/p/11180146.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!