Changeset 303
- Timestamp:
- 10/03/05 16:10:35 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r302 r303 8 8 # filename glasgow1.x3d 9 9 # filename vienna.x3d 10 filename ../data/vienna/vienna-simple.x3d11 #filename ../data/vienna/viewcells-25-sel.x3d10 # filename ../data/vienna/vienna-simple.x3d 11 filename ../data/vienna/viewcells-25-sel.x3d 12 12 # filename ../data/atlanta/atlanta2.x3d 13 13 # filename ../data/soda/soda.dat … … 15 15 # viewcells ../data/atlanta/atlanta_viewcells_large.x3d 16 16 # viewcells ../data/atlanta/atlanta_viewcells_large2.x3d 17 #viewcells ../data/vienna/viewcells-25-sel.x3d18 viewcells ../data/vienna/viewcells-25.x3d17 viewcells ../data/vienna/viewcells-25-sel.x3d 18 # viewcells ../data/vienna/viewcells-25.x3d 19 19 # viewcells ../data/vienna/viewcells-large-sel.x3d 20 20 } … … 75 75 # least splits + balanced polygons 76 76 #splitPlaneStrategy 12 77 splitPlaneStrategy 32 77 78 #axis aligned + vertical axis 78 splitPlaneStrategy 66 79 #splitPlaneStrategy 66 80 79 81 # axis aligned + balanced view cells 80 82 # splitPlaneStrategy 18 83 81 84 # largest polygon area 82 85 #splitPlaneStrategy 32 86 83 87 # axus aligned + balanced polygons 84 88 #splitPlaneStrategy 72 89 85 90 # constructionMethod rays 86 constructionMethod viewCells87 #constructionMethod sceneGeometry91 # constructionMethod viewCells 92 constructionMethod sceneGeometry 88 93 maxCandidates 25 89 94 maxViewCells 999999 90 95 Termination { 91 maxPolysForAxisAligned 20092 maxPolygons 096 maxPolysForAxisAligned 50 97 maxPolygons 5 93 98 maxDepth 100 94 99 } -
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
r297 r303 95 95 ObjectContainer objects; 96 96 RayContainer rays; 97 97 ViewCellContainer dummy; 98 98 switch (BspTree::sConstructionMethod) 99 99 { … … 102 102 break; 103 103 case BspTree::SCENE_GEOMETRY: 104 #if 0 104 105 CLEAR_CONTAINER(mViewCells); // we generate new view cells 105 106 106 mSceneGraph->CollectObjects(&objects); 107 107 mBspTree->Construct(objects, &mViewCells); 108 #else 109 for (int i=0; i< mViewCells.size(); ++i) 110 objects.push_back(mViewCells[i]); 111 112 mBspTree->Construct(objects, &dummy); 113 #endif 108 114 break; 109 115 case BspTree::RAYS: -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r302 r303 22 22 float BspTree::sCt_div_ci = 1.0f; 23 23 float BspTree::sSplitBorder = 1.0f; 24 float BspTree::sMaxCostRatio = 0.9 ;24 float BspTree::sMaxCostRatio = 0.9f; 25 25 26 26 //-- factors for bsp tree split plane heuristics … … 260 260 mRoot(NULL), 261 261 mViewCell(viewCell), 262 //mStorePolys(true)263 mStorePolys(false)262 mStorePolys(true) 263 //mStorePolys(false) 264 264 { 265 265 Randomize(); // initialise random generator for heuristics … … 437 437 else // reached leaf => subdivide current viewcell 438 438 { 439 if (tData.mPolygons->size() > 0)440 Debug << "Subdividing further: polygon size: " << (int)tData.mPolygons->size() << ", view cell: " << tData.mViewCell << endl;439 //if (tData.mPolygons->size() > 0) 440 // Debug << "Subdividing further: polygon size: " << (int)tData.mPolygons->size() << ", view cell: " << tData.mViewCell << endl; 441 441 442 442 BspNode *root = Subdivide(tStack, tData, viewCells); … … 504 504 // TODO: handle transformed mesh instances 505 505 default: 506 Debug << "intersectable type not supported" << endl; 506 507 break; 507 508 } … … 528 529 // construct tree from viewcell polygons 529 530 Construct(polys); 530 //Export("bsp.x3d");531 531 } 532 532 … … 542 542 mStat.polys = Copy2PolygonSoup(objects, *polys); 543 543 544 bool tmpStorePolys = mStorePolys; 545 mStorePolys = false; 546 544 547 // construct tree from polygon soup 545 548 Construct(polys, viewCells); 549 550 mStorePolys = tmpStorePolys; 551 // filter scene bounding box down the tree in order to store split polygons 552 if (mStorePolys) 553 { 554 Mesh *polyMesh = new Mesh(); 555 556 for (int i = 0; i < 6; ++i) 557 polyMesh->AddRectangle(mBox.GetFace(i)); 558 559 PolygonContainer *polys = new PolygonContainer(); 560 AddMesh2Polygons(polyMesh, *polys, NULL); 561 562 InsertPolygons(polys); 563 564 delete polyMesh; 565 } 546 566 } 547 567 … … 585 605 if ((tData.mPolygons->size() <= sTermMaxPolygons) || (tData.mDepth >= sTermMaxDepth)) 586 606 { 587 //#ifdef _DEBUG607 #ifdef _DEBUG 588 608 Debug << "subdivision terminated at depth " << tData.mDepth << ", #polys: " << (int)tData.mPolygons->size() << endl; 589 //#endif609 #endif 590 610 591 611 EvaluateLeafStats(tData); … … 602 622 } 603 623 //-- add viewcell stored in split polygon 604 else 605 { 606 if (leaf->GetViewCell()) 607 Debug << "ERROR: leaf already has view cell " << endl;//leaf->mViewCellIdx << endl; 608 609 //leaf->mViewCellIdx = counter; Debug << "insert view cell " << tData.mViewCell << endl; 624 else if (leaf->GetViewCell()) 610 625 leaf->SetViewCell(tData.mViewCell); 611 }612 626 //else Debug << "Leaf already has view cell " << endl; 627 613 628 // remaining polygons are discarded or added to node 614 629 tData.mNode->ProcessPolygons(tData.mPolygons, mStorePolys); … … 635 650 636 651 if (!viewCells) 637 { 652 { // extract the pointer to the view cells 638 653 ExtractViewCells(&backViewCell, 639 654 &frontViewCell, … … 643 658 backPolys->empty()); 644 659 } 645 660 646 661 // don't need coincident polygons anymore 647 662 interior->ProcessPolygons(&coincident, mStorePolys); … … 683 698 foundFront = true; 684 699 } 700 //if (foundFront) Debug << "front viewCell: " << *frontViewCell << endl; 701 //if (foundBack) Debug << "back viewCell: " << *backViewCell << endl; 685 702 } 686 703 } … … 921 938 { 922 939 Vector3 tinyAxis(0,0,0); tinyAxis[mBox.Size().TinyAxis()] = 1.0f; 923 // w ant toput a penalty on the dot product between the "tiny" vertical axis940 // we put a penalty on the dot product between the "tiny" vertical axis 924 941 // and the split plane axis 942 // NOTE: weight with poly size because vertical split more important if too many polygons 925 943 val += sVerticalSplitsFactor * 926 944 fabs(DotProd(candidatePlane.mNormal, tinyAxis)) * (float)polys.size(); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r302 r303 513 513 514 514 /// if polygons should be stored in the tree 515 bool mStore Polys;515 bool mStoreSplitPolys; 516 516 517 517 /// view cell corresponding to unbounded space -
trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
r302 r303 40 40 41 41 // if BSP tree construction method needs predefined view cells 42 if (BspTree::sConstructionMethod == BspTree::VIEW_CELLS) 42 43 if (1)//(BspTree::sConstructionMethod == BspTree::VIEW_CELLS) 43 44 { 44 45 if (vcFilename != "") … … 52 53 p->BuildBspTree(); 53 54 p->BspTreeStatistics(Debug); 54 p->Export("vc_bsptree .x3d", false, false, true);55 p->Export("vc_bsptree2.x3d", false, false, true); 55 56 57 #if 0 56 58 //-- export the complementary view cells 57 59 // i.e., the view cells not associated with leafs in the tree. … … 70 72 if (exporter) 71 73 { 74 Debug << Exporting complementary view cells" << endl; 72 75 exporter->ExportViewCells(&vc_compl); // export view cells 73 76 delete exporter; 74 77 } 78 #endif 75 79 76 80 #endif
Note: See TracChangeset
for help on using the changeset viewer.