Line | |
---|
1 | #include "ObjConverter.h"
|
---|
2 | //#include "PlyConverter.h"
|
---|
3 | #include <iostream>
|
---|
4 | #include <time.h>
|
---|
5 |
|
---|
6 | using namespace std;
|
---|
7 |
|
---|
8 |
|
---|
9 | int main(int argc, char* argv[])
|
---|
10 | {
|
---|
11 | int returnCode = 0;
|
---|
12 |
|
---|
13 | //ObjConverter2 converter;
|
---|
14 | ObjConverter converter;
|
---|
15 | //PlyConverter converter;
|
---|
16 |
|
---|
17 | cout << "converting obj to dem format" << endl;
|
---|
18 | #if 1
|
---|
19 | /*if (!converter.LoadMaterials(model_path + argv[3]))
|
---|
20 | {
|
---|
21 | cerr << "loading materials failed" << endl;
|
---|
22 |
|
---|
23 | std::cin.get();
|
---|
24 | exit(0);
|
---|
25 | }*/
|
---|
26 |
|
---|
27 | if (!converter.Convert(model_path + argv[1], model_path + argv[2]))
|
---|
28 | {
|
---|
29 | cerr << "conversion failed" << endl;
|
---|
30 |
|
---|
31 | std::cin.get();
|
---|
32 | exit(0);
|
---|
33 | }
|
---|
34 | #else
|
---|
35 |
|
---|
36 | //const int numFiles = 879;
|
---|
37 | const int numFiles = 3;
|
---|
38 |
|
---|
39 | vector<string> filenames;
|
---|
40 | const string base(model_path + argv[1]);
|
---|
41 |
|
---|
42 | char filename[100];
|
---|
43 |
|
---|
44 | for (int i = 0; i < numFiles; ++ i)
|
---|
45 | {
|
---|
46 | sprintf(filename, "%s%s%d%s", base.c_str(), ".b", i, ".obj");
|
---|
47 | filenames.push_back(filename);
|
---|
48 | }
|
---|
49 |
|
---|
50 | //cout << "press any key" << std::cin.get();
|
---|
51 |
|
---|
52 | if (!converter.Convert2(filenames, model_path + argv[2]))
|
---|
53 | {
|
---|
54 | cerr << "conversion failed" << endl;
|
---|
55 |
|
---|
56 | std::cin.get();
|
---|
57 | exit(0);
|
---|
58 | }
|
---|
59 | #endif
|
---|
60 |
|
---|
61 | cout << "conversion successful" << endl;
|
---|
62 | cout << "press any key" << std::cin.get();
|
---|
63 |
|
---|
64 | return 0;
|
---|
65 | }
|
---|
66 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.