本文整理汇总了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);
}
示例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;
}