- Timestamp:
- 01/11/09 22:54:05 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter2.cpp
r3265 r3268 128 128 for (int j = 0; j < 3; ++ j) 129 129 { 130 if (tIndices[idx[j]] >= (int)texcoords.size())131 cerr << "error: texcoord indices exceed array size " << texcoords.size() << " " << tIndices[idx[j]] << endl;130 //if (tIndices[idx[j]] >= (int)texcoords.size()) 131 //cerr << "error: texcoord indices exceed array size " << texcoords.size() << " " << tIndices[idx[j]] << endl; 132 132 const int tidx = min((int)texcoords.size() - 1, tIndices[idx[j]]); 133 133 … … 240 240 vector<string>::const_iterator it, it_end = filenames.end(); 241 241 242 ofstream outstr("mydebug.log"); 243 242 244 for (it = filenames.begin(); it != it_end; ++ it) 243 245 { … … 245 247 246 248 cout << "\n==================\n loading file " << filename << endl; 249 250 outstr << "loading file: " << filename << endl; 251 outstr << flush; 247 252 248 253 if (!ReadFile(filename)) … … 253 258 } 254 259 255 cout << "\n*******************\n 260 cout << "\n*******************\nwriting file " << outputFilename << endl; 256 261 257 262 if (!WriteFile(outputFilename)) … … 385 390 { 386 391 cerr << "loading material library failed" << endl; 387 exit(0);392 return false; 388 393 } 389 394 } … … 538 543 } 539 544 545 ofile.close(); 546 540 547 return true; 541 548 } … … 545 552 { 546 553 FILE *file; 547 548 554 if ((file = fopen(matFileName.c_str(), "r")) == NULL) return false; 549 555 … … 610 616 } 611 617 618 fclose(file); 619 612 620 return true; 613 621 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/main.cpp
r3265 r3268 31 31 #else 32 32 33 //const int numFiles = 879;34 const int numFiles = 10;33 const int numFiles = 879; 34 //const int numFiles = 300; 35 35 36 36 vector<string> filenames; 37 37 const string base(model_path + argv[1]); 38 38 39 char filename[100]; 40 39 41 for (int i = 0; i < numFiles; ++ i) 40 42 { 41 char filename[100];42 43 sprintf(filename, "%s%s%d%s", base.c_str(), ".b", i, ".obj"); 43 44 filenames.push_back(filename); 44 45 } 46 47 //cout << "press any key" << std::cin.get(); 45 48 46 49 if (!converter.Convert2(filenames, model_path + argv[2])) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj
r3266 r3268 155 155 IgnoreAllDefaultLibraries="false" 156 156 IgnoreDefaultLibraryNames="LIBCMT" 157 GenerateDebugInformation=" true"157 GenerateDebugInformation="false" 158 158 SubSystem="1" 159 159 LargeAddressAware="2" -
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3262 r3268 8 8 9 9 filename=vienna_full_hp 10 filename=procedural_pompeii_area6_hires/pompeii 10 11 #filename=city 11 12 useLODs=1 … … 47 48 48 49 # initial camera position 49 camPosition=483.398f 242.364f 186.078f 50 #camPosition=483.398f 242.364f 186.078f 51 camPosition=1300.0f -2500.0f 10.0f 52 50 53 # initial camera orientation 51 54 camDirection=1 0 0 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhConstructor.cpp
r3267 r3268 130 130 // no split could be achieved => just halve number of objects 131 131 split = (leaf->mLast + leaf->mFirst) / 2; 132 cerr << "no reduction " << leaf->CountPrimitives() << " " << leaf->mFirst << " " << leaf->mLast << endl;132 //cerr << "no reduction " << leaf->CountPrimitives() << " " << leaf->mFirst << " " << leaf->mLast << endl; 133 133 } 134 134 … … 185 185 BvhLeaf *l = new BvhLeaf(NULL); 186 186 187 l->mBox = SceneEntity::ComputeBoundingBox(mEntities + mFirst, mFirst - mLast + 1);188 189 187 l->mFirst = mFirst; 190 188 l->mLast = mLast; 189 190 cout << "constructing bvh from " << l->mFirst << " to " << l->mLast << endl; 191 192 l->mBox = SceneEntity::ComputeBoundingBox(mEntities + mFirst, mLast - mFirst + 1); 191 193 l->mArea = l->mBox.SurfaceArea(); 192 194 193 cout << "constructing bvh from " << l->mFirst << " to " << l->mLast << endl;194 195 195 root = SubdivideLeaf(l, 0); 196 196 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp
r3262 r3268 187 187 AxisAlignedBox3 box; 188 188 189 if ( !numEntities)189 if (numEntities <= 0) 190 190 { // no box => just initialize 191 191 box.Initialize(); … … 209 209 AxisAlignedBox3 box; 210 210 211 if ( !entities.empty())211 if (entities.empty()) 212 212 { // no box => just initialize 213 213 box.Initialize(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp
r3250 r3268 109 109 110 110 // scale the sky dome so no intersection with the scene is visible 111 //const float scaleFactor = 80.0f;112 const float scaleFactor = 500.0f;111 const float scaleFactor = 80.0f; 112 //const float scaleFactor = 500.0f; 113 113 114 114 position.z -= 3.0f * scaleFactor; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3267 r3268 587 587 //LoadModel("sibenik.dem", dynamicObjects); 588 588 589 LoadModel("procedural_pompeii_area6_hires/pompeii.dem", dynamicObjects);590 589 //LoadModel("procedural_pompeii_area6_hires/pompeii.dem", dynamicObjects); 590 /* 591 591 AxisAlignedBox3 box; 592 592 box.Initialize(); … … 603 603 604 604 cout << "pompeii bb:\n" << box << endl; 605 605 */ 606 606 #if 0 607 607 const Vector3 sceneCenter(470.398f, 240.364f, 181.7f); … … 645 645 646 646 BvhFactory bvhFactory; 647 //bvh = bvhFactory.Create(bvh_filename, staticObjects, dynamicObjects, maxDepthForTestingChildren); 647 #if 1 648 648 bvh = bvhFactory.Create(staticObjects, dynamicObjects, maxDepthForTestingChildren); 649 #else 650 bvh = bvhFactory.Create(bvh_filename, staticObjects, dynamicObjects, maxDepthForTestingChildren); 651 #endif 649 652 650 653 if (!bvh)
Note: See TracChangeset
for help on using the changeset viewer.