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


C++ Importer::getMesh方法代码示例

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


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

示例1: main

int main()
{
	Importer importer;
	if (!importer.importFile("C://Users/Litet/Documents/GitHub/SmallGameProject/FBX Export/FBX Export/rekt.bin"))
	{
		std::cout << "IMPORTER FAIL!!!" << endl;
	}

	ofstream out("C://Users/Litet/Documents/GitHub/SmallGameProject/FBX Export/FBX Export/Portal_test_FBX_ImporterTest.txt");
	//out << importer.headers << endl;

	const ImporterTransform* transforms = importer.getTransform();
	for (unsigned int i = 0; i < importer.getNumTransforms(); i++)
	{
		out << transforms[i].name << endl;
		out << transforms[i].rotation[0] << " " << transforms[i].rotation[1] << " " << transforms[i].rotation[2] << " " << transforms[i].rotation[3] << " " << endl;
	}

	const ImporterMesh* meshes = importer.getMesh();
	for (unsigned int i = 0; i < importer.getNumMeshes(); i++)
	{
		out << meshes[i].position_count << endl;
		for (unsigned int j = 0; j < meshes[i].position_count; j++)
			out << meshes[i].position[j] << endl;

		for (unsigned int j = 0; j < meshes[i].uv_count; j++)
			out << meshes[i].uv[j] << endl;

		for (unsigned int j = 0; j < meshes[i].normal_count; j++)
			out << meshes[i].normal[j] << endl;

		for (unsigned int j = 0; j < meshes[i].indice_count; j++)
			out << meshes[i].vertices[j] << endl;
	}

	//for (unsigned int i = 0; i < importer.headers.joint_count; i++)
	//	out << importer.joints[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.camera_count; i++)
	//	out << importer.cameras[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.mesh_count; i++)
	//	out << importer.meshes[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.light_count; i++)
	//	out << importer.lights[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.nurb_count; i++)
	//	out << importer.nurbs[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.morph_count; i++)
	//	out << importer.morph[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.skin_count; i++)
	//	out << importer.skins[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.anim_curve_count; i++)
	//	out << importer.getCurves()[i] << endl;

	//for (unsigned int i = 0; i < importer.headers.material_count; i++)
	//{
	//	out << importer.materials[i].name_length;
	//	out << importer.materials[i].duffuse_map_length;
	//	out << importer.materials[i].normal_map_length;
	//	out << importer.materials[i].specular_map_length;
	//	out << importer.materials[i].mtrl_type;
	//	out << importer.materials[i].normal_depth;
	//	out << importer.materials[i].specular[0];
	//	out << importer.materials[i].specular[1];
	//	out << importer.materials[i].specular[2];
	//	out << importer.materials[i].specular_factor;
	//	out << importer.materials[i].shininess;
	//	out << importer.materials[i].reflection[0];
	//	out << importer.materials[i].reflection[1];
	//	out << importer.materials[i].reflection[2];
	//	out << importer.materials[i].reflection_factor;
	//	out << importer.materials[i].ambient[0];
	//	out << importer.materials[i].ambient[1];
	//	out << importer.materials[i].ambient[2];
	//	out << importer.materials[i].diffuse[0];
	//	out << importer.materials[i].diffuse[1];
	//	out << importer.materials[i].diffuse[2];
	//	out << importer.materials[i].diffuse_factor;
	//	out << importer.materials[i].transparency_color[0];
	//	out << importer.materials[i].transparency_color[1];
	//	out << importer.materials[i].transparency_color[2];
	//	out << importer.materials[i].incandescence[0];
	//	out << importer.materials[i].incandescence[1];
	//	out << importer.materials[i].incandescence[2];
	//	out << importer.materials[i].name;
	//	//out << importer.materials[i].diffuse_map;
	//	//out << importer.materials[i].normal_map;
	//	//out << importer.materials[i].specular_map;
	//};


	//for (unsigned int i = 0; i < importer.headers.group_count; i++)
	//{
	//	out << importer.transforms[i].name_Length;
	//	out << importer.transforms[i].parentID;
//.........这里部分代码省略.........
开发者ID:FakeShemp,项目名称:SmallGameProject,代码行数:101,代码来源:main.cpp


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