本文整理汇总了C++中MyMesh::MergeVertices方法的典型用法代码示例。如果您正苦于以下问题:C++ MyMesh::MergeVertices方法的具体用法?C++ MyMesh::MergeVertices怎么用?C++ MyMesh::MergeVertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyMesh
的用法示例。
在下文中一共展示了MyMesh::MergeVertices方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
if (argc < 2){
return 0;
}
float meshPrecision = 0.01;
MyMesh mesh;
//mesh.Read(argv[1]);
//mesh.MergeVertices(meshPrecision);
//mesh.ClearNonRegularFaces();
//mesh.GenPerVertexNormal();
mesh.Read("data\\lh.pial.DK.fusiform_trans.obj");
//mesh.ReadAsc("data\\lh.pial.asc");
mesh.MergeVertices(meshPrecision);
//mesh.RemoveVertex(MyArrayi(1, 40969));
mesh.GenPerVertexNormal();
mesh.Write("data\\lh.pial.DK.fusiform_trans_normal.obj");
//mesh.WriteNOFF("data\\lh.pial.off");
//mesh.WriteAsc("data\\lh.sphere_v163841.asc");
//mesh.WriteBIN("data\\lh.pial_v163841.bin");
//mesh.WriteNOFF("data\\lh_trans_pial_noff.off");
//mesh.WritePLY("data\\lh.pial.ply");
//mesh.WriteSMFD("data\\lh.trans.pial.smfd");
//MyTracks track;
//track.Read("C:\\Users\\GuohaoZhang\\Desktop\\tmpdata\\dti.trk");
//track.Save("C:\\Users\\GuohaoZhang\\Desktop\\tmpdata\\dti.data");
/*
MyTracks track;
track.Read("C:\\Users\\GuohaoZhang\\Desktop\\tmpdata\\dti.trk");
vector<int> idx;
for (int i = 0; i < track.GetNumTracks(); i++){
idx.push_back(i);
}
vector<int> filter1, filter2;
float lengthLimit[] = { 20, FLT_MAX };
track.FilterByIndexSkip(idx, 0.99, filter1);
cout << filter1.size() << endl;
track.FilterByTrackLength(filter1, lengthLimit, filter2);
cout << filter2.size() << endl;
track.SavePartial("dti_20_099.data", filter2);
*/
}
示例2: main
int main(int argc, char* argv[])
{
/****************************************/
/* Initialize GLUT and create window */
/****************************************/
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowPosition(80, 80);
glutInitWindowSize(windowWidth, windowHeight);
int main_window = glutCreateWindow("Rendering Test");
glewInit();
glutDisplayFunc(myGlutDisplay);
glutMotionFunc(myGlutMotion);
glutReshapeFunc(myGlutReshape);
glutPassiveMotionFunc(myGlutPassiveMotion);
glutMouseWheelFunc(myGlutMouseWheel);
glutMouseFunc(myGlutMouse);
glutKeyboardFunc(myGlutKeyboard);
glEnable(GL_DEPTH_TEST);
/****************************************/
/* Here's the GLSL code */
/****************************************/
geomFb.AddExtraDrawTexture(GL_RGBA32F, GL_RGBA, GL_FLOAT, GL_NEAREST, GL_CLAMP_TO_EDGE);
geomFb.AddExtraDrawTexture(GL_RGBA32F, GL_RGBA, GL_FLOAT, GL_NEAREST, GL_CLAMP_TO_EDGE);
glClampColor(GL_CLAMP_READ_COLOR, GL_FALSE);
glClampColor(GL_CLAMP_VERTEX_COLOR, GL_FALSE);
glClampColor(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
/****************************************/
/* Loading Data */
/****************************************/
ssaoPass.Build();
blurPass.Build();
lightingPass.Build();
#ifdef TRACK
trackBall.SetRotationMatrix(MyMatrixf::RotateMatrix(90, 1, 0, 0));
trackBall.ScaleMultiply(1.3);
MyTracks tractData;
MyBitmap bitmap;
bitmap.Open("..\\SSAO\\data\\diverging.bmp");
gTex = MyTexture::MakeGLTexture(&bitmap);
//tractData.Read("data\\normal_s3.data");
tractData.Read("C:\\Users\\GuohaoZhang\\Dropbox\\data\\normal_s4.tensorinfo");
tractData.AppendTrackColor("C:\\Users\\GuohaoZhang\\Dropbox\\data\\normal_s4_boy.data");
tractData.Save("C:\\Users\\GuohaoZhang\\Dropbox\\data\\normal_s4_tensorboy.trk");
return 1;
tractData.Read("C:\\Users\\GuohaoZhang\\Dropbox\\data\\normal_s3_tensorboy_RevZ.trk");
//tractData.Read("data\\normal_s5.tensorinfo");
//tractData.Read("data\\normal_s5_2pt.tensorinfo");
//tractData.Read("data\\cFile.tensorinfo");
//tractData.Read("C:\\Users\\GuohaoZhang\\Desktop\\tmpdata\\dti.trk");
//tractData.Read("C:\\Users\\GuohaoZhang\\Desktop\\tmpdata\\ACR.trk");
//tractData.Read("dti_20_0995.data");
track.SetTracts(&tractData);
track.SetTexture(gTex);
//track.SetShape(MyTractVisBase::TRACK_SHAPE_LINE);
track.SetShape(MyTractVisBase::TrackShape(trackShape + 1));
track.ComputeGeometry();
track.LoadShader();
track.LoadGeometry();
trackLine.SetTracts(&tractData);
trackLine.SetShape(MyTractVisBase::TRACK_SHAPE_LINE);
trackLine.ComputeGeometry();
trackLine.LoadShader();
trackLine.LoadGeometry();
track.SetToInfluence(tractEncoding);
MyVec3f center = track.GetTracts()->GetBoundingBox().GetCenter();
cout << "Center: " << center[0] << ", " << center[1] << ", " << center[2] << endl;
#endif
#ifdef MESH
gTex = MakeTexture("2dir_128.bmp");
meshPrecision = 0.01;
//mesh.Read("data\\lh.trans.pial.obj");
mesh.Read("data\\lh.pial.DK.fusiform_trans.obj");
//mesh.Read("lh.pial.obj");
//mesh.Read("data\\lh.trans.pial.obj");
//MyMesh mesh2;
//mesh2.Read("data\\rh.trans.pial.obj");
//mesh.Merge(mesh2);
mesh.MergeVertices(meshPrecision);
mesh.GenPerVertexNormal();
//mesh.Write("data\\rh.trans_wnormal.pial.obj");
mesh.CompileShader();
mesh.mTexture = gTex;
mesh.Build();
//glEnable(GL_BLEND);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//.........这里部分代码省略.........
示例3: changeMeshPrecision
void changeMeshPrecision(int mode){
mesh.Read("data\\lh.pial.obj");
mesh.MergeVertices(meshPrecision);
mesh.GenPerVertexNormal();
mesh.Build();
}