当前位置: 首页>>代码示例>>C++>>正文


C++ MeshBuilder::saveMesh方法代码示例

本文整理汇总了C++中MeshBuilder::saveMesh方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshBuilder::saveMesh方法的具体用法?C++ MeshBuilder::saveMesh怎么用?C++ MeshBuilder::saveMesh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MeshBuilder的用法示例。


在下文中一共展示了MeshBuilder::saveMesh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: generateMesh

void generateMesh(Terrain* const t,const QString& obj,int echantillion){

    MeshBuilder bu;
    QString nom="terrain";
    Mesh m =bu.terrain(*t,echantillion,nom);
    bu.saveMesh(obj,m);

}
开发者ID:Bosphoros,项目名称:Synthese-Image-Lucas-Florian-2015-2016,代码行数:8,代码来源:main.cpp

示例2: main

int main(int argc, char *argv[])
{
    /*int arg=1;
    QTime time;

    float values[9] = {1.0f,2.0f,3.0f,4.0f,5.0f,6.0f,7.0f,8.0f,9.0f};

    Matrix3 mat(values);

    cout << mat << endl;

    cout << mat.transpose() << endl;*/

   /* time.restart();
    QString img=argv[arg++];
    Terrain* t=generationImage(img);
    std::cout << "Terrain from image generated : " << time.restart() << "ms." << std::endl;//*/

     /* time.restart();
      Terrain* t=generationProcedural();
      std::cout << "Terrain generated : " << time.restart() << "ms." << std::endl;
     //*/


    /*time.restart();
    QString obj=argv[arg++];
    generateMesh(t,obj,300);
    std::cout << "Mesh generated : " << time.restart() << "ms." << std::endl;//*/

    /*time.restart();
    QString destination=argv[arg++];
    shoot(t,destination);
    std::cout << "Image generated from ray launching : " << time.restart() << "ms." << std::endl;//*/

   /* time.restart();
    QString destination=argv[arg++];

    shootMulti(t,destination,100);
    std::cout << "100 images generated from ray launching : " << time.restart() << "ms." << std::endl;//*/

    //delete t;

    /*Vector3D centre(1.0f,0.0f,0.0f);
    Vector3D centre2(.5f,.5f,0.0f);

    Vector3D origine(-3.0f,0.0f,0.0f);
    Vector3D direction(1.0f,0.0f,0.0f);

    Vector3D soleil(-10000.0f,0.0f,0.0f);

    CSGSphere sphere(centre, 1.0f);
    CSGSphere sphere2(centre2, 0.75f);


    CSGDifference uni(&sphere,&sphere2);

    Camera cam(origine, direction,1.0);

    QImage result = cam.printScreen(uni, soleil, 900, 900);

    QString nameImage = "C:/Users/etu/Desktop/sphereTest.png";
    result.save(nameImage);



    MeshBuilder mb;
    TableauVoxel tab(500,500,500,10.0/500,Vector3D(-5,-5,-5),uni);
    //TableauVoxel tab(3,3,3,10,Vector3D(0,0,0));
    //tab(1,1,1)=1;
    QString name2 = "C:/Users/etu/Desktop/voxel.obj";
    Mesh m=mb.voxel(tab,name2);
    mb.saveMesh(name2,m);*/

    QList<Vector3D> points = Vector3D::randHemisphere(1000);
    QList<Vector3D> points2 = Vector3D::rotateScaleTranslate(points, Vector3D(0,0,0), 1, Vector3D(0,0.5,0.5).normalized());
    QList<int> topo;
    QList<Vector3D> normales;
    Mesh m1(points, topo, normales, "ololo");
    Mesh m2(points2, topo, normales, "ololo2");

    MeshBuilder m;
    m.saveMesh("m1.obj", m1);
    m.saveMesh("m3.obj", m2);

    return 0;
}
开发者ID:Bosphoros,项目名称:Synthese-Image-Lucas-Florian-2015-2016,代码行数:86,代码来源:main.cpp


注:本文中的MeshBuilder::saveMesh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。