Changeset 3273 for GTP/trunk/App/Demos/Vis
- Timestamp:
- 01/13/09 12:43:51 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/VisibilitySolutionConverter/VisibilitySolutionConverter.cpp
r3272 r3273 52 52 { 53 53 vector<string> triples; 54 54 55 char *next_token; 55 56 … … 60 61 { 61 62 string s(pch); 62 //s += "\n",63 63 triples.push_back(s); 64 64 … … 66 66 } 67 67 68 // throw away last symbol (\n) 69 triples.back().resize(triples.back().size() - 1); 70 68 71 vector<int> indices; 69 72 vector<int> nIndices; 70 73 vector<int> tIndices; 71 74 72 char seps[] = " /\t\n"; 75 char seps[] = " "; 76 char seps2[] = "/"; 73 77 74 78 for (size_t i = 0; i < triples.size(); ++ i) 75 79 { 76 static int dummy = 0;77 78 80 size_t found; 79 found = triples[i].find_first_of(seps );81 found = triples[i].find_first_of(seps2); 80 82 size_t prevfound = 0; 81 // vertex, normal, texture indices 83 84 // extract vertex, normal, texture indices 82 85 string str = triples[i].substr(prevfound, found); 83 86 84 87 int index = (int)strtol(str.c_str(), NULL, 10) - 1; 85 86 88 int tIndex = index; 87 89 int nIndex = index; 88 90 89 prevfound = found; 90 found = triples[i].find_first_of(seps, found + 1); 91 // try to extract texture and normal indices 92 prevfound = found + 1; 93 found = triples[i].find_first_of(seps2, prevfound); 91 94 92 95 if (found != string::npos) … … 97 100 if (idx > 0) tIndex = idx; 98 101 } 99 100 if ( (found + 1) < triples[i].size())102 103 if (found != string::npos) 101 104 { 102 105 str = triples[i].substr(found + 1); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3272 r3273 7 7 # misc stuff 8 8 9 #filename=vienna_full_hp10 #bvhname=vienna_full_hp11 filename=newvienna12 bvhname=newvienna9 filename=vienna_full_hp 10 bvhname=vienna_full_hp 11 #filename=newvienna 12 #bvhname=newvienna 13 13 #filename=procedural_pompeii_area6_hires/pompeii_full 14 14 #filename=procedural_pompeii_area6_hires/pompeii_part -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhExporter.cpp
r3272 r3273 99 99 ConstructTriangleRangeMap(bvh, bvh->GetStaticRoot(), first, last); 100 100 101 Bvh LeafContainer nodes;102 bvh->Collect Leaves(bvh->GetStaticRoot(), nodes);101 BvhNodeContainer nodes; 102 bvh->CollectVirtualLeaves(bvh->GetStaticRoot(), nodes); 103 103 104 104 vector<int> triangles; 105 105 106 Bvh LeafContainer::const_iterator it, it_end = nodes.end();106 BvhNodeContainer::const_iterator it, it_end = nodes.end(); 107 107 108 108 for (it = nodes.begin(); it != it_end; ++ it) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ObjExporter.cpp
r3272 r3273 53 53 int numVertices = 0; 54 54 55 Bvh LeafContainer nodes;56 bvh->Collect Leaves(bvh->GetStaticRoot(), nodes);55 BvhNodeContainer nodes; 56 bvh->CollectVirtualLeaves(bvh->GetStaticRoot(), nodes); 57 57 58 58 cout << "writing " << nodes.size() << " objects ..." << endl; 59 59 60 Bvh LeafContainer::const_iterator it, it_end = nodes.end();60 BvhNodeContainer::const_iterator it, it_end = nodes.end(); 61 61 62 62 int j = 0; … … 99 99 for (int i = 0; i < numVertices; i += 3) 100 100 { 101 ostream << "f " << i + 2<< " " << i + 2 << " " << i + 3 << endl;101 ostream << "f " << i + 1 << " " << i + 2 << " " << i + 3 << endl; 102 102 } 103 103 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3272 r3273 148 148 bool useSkylightForIllum = true; 149 149 150 bool showFPS = true; 151 150 152 static int globalVisibleId = 0; 151 153 … … 724 726 725 727 726 //ObjExporter().Export(model_path + "myvienna.obj", bvh);727 //BvhExporter().Export(model_path + "myvienna.bv", bvh);728 ObjExporter().Export(model_path + "myvienna.obj", bvh); 729 BvhExporter().Export(model_path + "myvienna.bv", bvh); 728 730 729 731 … … 1709 1711 if (!usePvs) SceneEntity::SetCurrentVisibleId(-1); 1710 1712 break; 1713 case ',': 1714 // show / hide FPS 1715 showFPS = !showFPS; 1716 break; 1717 1711 1718 default: 1712 1719 return; … … 2422 2429 2423 2430 if (!showAlgorithmTime) 2424 sprintf(msg[7], "%s: %6.1f fps", alg_str[renderMode], fps); 2431 { 2432 if (showFPS) 2433 sprintf(msg[7], "%s: %6.1f fps", alg_str[renderMode], fps); 2434 } 2425 2435 else 2426 2436 sprintf(msg[7], "%s: %6.1f ms", alg_str[renderMode], rTime);
Note: See TracChangeset
for help on using the changeset viewer.