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

Revision 3372, 1.2 KB checked in by mattausch, 15 years ago (diff)

reverted but now a good version

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