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