source: GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/main.cpp @ 3334

Revision 3334, 1.3 KB checked in by mattausch, 15 years ago (diff)

performance testing (only depth texture faster??) loading torus, two objects that interleave

RevLine 
[3295]1#include "ObjConverter.h"
[2961]2#include <iostream>
[3076]3#include <time.h>
[2961]4
5using namespace std;
6
7
8int main(int argc, char* argv[])
9{
10        int returnCode = 0;
11
[3295]12        //ObjConverter2 converter;
13        ObjConverter converter;
[2961]14
15        cout << "converting obj to dem format" << endl;
[3334]16#if 1 // use this path for converting a file with materials
17        if  (argc > 3)
[3247]18        {
[3334]19                if (!converter.LoadMaterials(model_path + argv[3]))
20                {
21                        cerr << "loading materials failed" << endl;
[2961]22
[3334]23                        std::cin.get();
24                        exit(0);
25                }
[3247]26        }
27
[3012]28        if (!converter.Convert(model_path + argv[1], model_path + argv[2]))
[2961]29        {
30                cerr << "conversion failed" << endl;
[3076]31
32                std::cin.get();
[2961]33                exit(0);
34        }
[3334]35#else // use this bath to convert the pompeii model
[3261]36       
[3275]37        //const int numFiles = 879;
38        const int numFiles = 3;
[3247]39
[3261]40        vector<string> filenames;
41        const string base(model_path + argv[1]);
42
[3268]43        char filename[100];
44
[3261]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
[3268]51        //cout << "press any key" << std::cin.get();
52
[3261]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
[2961]62        cout << "conversion successful" << endl;
[3261]63        //cout << "press any key" << std::cin.get();
[3076]64
[2961]65        return 0;
66}
67
Note: See TracBrowser for help on using the repository browser.