Revision 3334,
1.3 KB
checked in by mattausch, 16 years ago
(diff) |
performance testing (only depth texture faster??) loading torus, two objects that interleave
|
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 // use this path for converting a file with materials
|
---|
17 | if (argc > 3)
|
---|
18 | {
|
---|
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 |
|
---|
28 | if (!converter.Convert(model_path + argv[1], model_path + argv[2]))
|
---|
29 | {
|
---|
30 | cerr << "conversion failed" << endl;
|
---|
31 |
|
---|
32 | std::cin.get();
|
---|
33 | exit(0);
|
---|
34 | }
|
---|
35 | #else // use this bath to convert the pompeii model
|
---|
36 |
|
---|
37 | //const int numFiles = 879;
|
---|
38 | const int numFiles = 3;
|
---|
39 |
|
---|
40 | vector<string> filenames;
|
---|
41 | const string base(model_path + argv[1]);
|
---|
42 |
|
---|
43 | char filename[100];
|
---|
44 |
|
---|
45 | for (int i = 0; i < numFiles; ++ i)
|
---|
46 | {
|
---|
47 | sprintf(filename, "%s%s%d%s", base.c_str(), ".b", i, ".obj");
|
---|
48 | filenames.push_back(filename);
|
---|
49 | }
|
---|
50 |
|
---|
51 | //cout << "press any key" << std::cin.get();
|
---|
52 |
|
---|
53 | if (!converter.Convert2(filenames, model_path + argv[2]))
|
---|
54 | {
|
---|
55 | cerr << "conversion failed" << endl;
|
---|
56 |
|
---|
57 | std::cin.get();
|
---|
58 | exit(0);
|
---|
59 | }
|
---|
60 | #endif
|
---|
61 |
|
---|
62 | cout << "conversion successful" << endl;
|
---|
63 | //cout << "press any key" << std::cin.get();
|
---|
64 |
|
---|
65 | return 0;
|
---|
66 | }
|
---|
67 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.