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