VCG Library
trimesh_import_fbx.cpp
1 /****************************************************************************
2 * VCGLib o o *
3 * Visual and Computer Graphics Library o o *
4 * _ O _ *
5 * Copyright(C) 2004-2016 \/)\/ *
6 * Visual Computing Lab /\/| *
7 * ISTI - Italian National Research Council | *
8 * \ *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
20 * for more details. *
21 * *
22 ****************************************************************************/
33 #include <vcg/complex/complex.h>
34 #include <wrap/io_trimesh/import_fbx.h>
35 #include <wrap/io_trimesh/export_obj.h>
36 #include <stdio.h>
37 
38 using namespace vcg;
39 
40 class MyFace;
41 class MyEdge;
42 class MyVertex;
43 
44 struct MyUsedTypes : public UsedTypes<Use<MyVertex>::AsVertexType, Use<MyFace>::AsFaceType>{};
45 
46 class MyVertex : public Vertex< MyUsedTypes, vertex::Coord3f, vertex::Normal3f, vertex::Qualityf, vertex::Color4b,vertex::BitFlags >{};
47 class MyFace : public Face < MyUsedTypes, face::VertexRef, face::Normal3f, face::Qualityf, face::WedgeTexCoord2f, face::Color4b, face::BitFlags > {};
48 class MyMesh : public tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> >{};
49 
50 int main()
51 {
52  MyMesh openMesh;
53 
54 // tri::io::ImporterFBX<MyMesh>::Open(openMesh,"Arabic_Censer/Arabic_Censer.FBX");
55 // tri::io::ImporterFBX<MyMesh>::Open(openMesh,"elephant/ELEPHANT_M.fbx");
56  tri::io::ImporterFBX<MyMesh>::Open(openMesh,"liontemple/sketchfabTemp.obj.fbx");
57 
58  tri::io::ExporterOBJ<MyMesh>::Save(openMesh,"sphere.obj",tri::io::Mask::IOM_WEDGTEXCOORD);
59  return 0;
60 }