source: trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp @ 242

Revision 242, 1.5 KB checked in by mattausch, 19 years ago (diff)

added output functions and castray method for bsp viewcells

Line 
1#include "SamplingPreprocessor.h"
2#include "ExactPreprocessor.h"
3#include "Parser.h"
4#include "UnigraphicsParser.h"
5#include "X3dParser.h"
6#include "Environment.h"
7#include "Camera.h"
8#include "MeshKdTree.h"
9
10#define USE_EXE_PATH false
11
12
13int
14main(int argc, const char **argv)
15{
16  Debug.open("debug.log");
17  environment = new Environment;
18  environment->Parse(argc, argv, USE_EXE_PATH);
19  MeshKdTree::ParseEnvironment();
20  BspTree::ParseEnvironment();
21
22  Preprocessor *p =
23    new SamplingPreprocessor();
24
25  char buff[128];
26  environment->GetStringValue("Scene.filename", buff);
27  string filename(buff);
28
29  p->LoadScene(filename);
30
31  p->BuildKdTree();
32  p->KdTreeStatistics(cout);
33#ifdef TEST_BSP_VIEWCELLS
34  p->GenerateViewcells();
35  p->BspTreeStatistics(Debug);
36#endif
37
38  //  p->mSceneGraph->Export("soda.x3d");
39  if (0) {
40    p->Export(filename + "-out.x3d", true, false, false);
41    p->Export(filename + "-kdtree.x3d", false, true, false);
42  }
43 
44  //  p->LoadViewcells("viewcells.wrl");
45  if (1) {
46    p->ComputeVisibility();
47    p->ExportPreprocessedData("scene.vis");
48  }
49
50  if (1) {
51    Camera camera;
52    //camera.LookAtBox(p->mKdTree->GetBox());
53        camera.LookInBox(p->mKdTree->GetBox());
54        camera.SetPosition(camera.mPosition + Vector3(0,300,0));
55    camera.SnapImage("camera.jpg", p->mKdTree);
56
57   
58    camera.LookInBox(p->mKdTree->GetBox());
59    camera.SetPosition(camera.mPosition - Vector3(0,100,0));
60    camera.SnapImage("camera2.png", p->mKdTree);
61  }
62
63 
64  return 0;
65}
66
Note: See TracBrowser for help on using the repository browser.