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


C++ MyMesh::Build方法代码示例

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


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

示例1: 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);

//.........这里部分代码省略.........
开发者ID:edgeofmoon,项目名称:Rendering,代码行数:101,代码来源:parameterTest.cpp

示例2: changeMeshPrecision

void changeMeshPrecision(int mode){
	mesh.Read("data\\lh.pial.obj");
	mesh.MergeVertices(meshPrecision);
	mesh.GenPerVertexNormal();
	mesh.Build();
}
开发者ID:edgeofmoon,项目名称:Rendering,代码行数:6,代码来源:parameterTest.cpp


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