Changeset 298
- Timestamp:
- 09/28/05 17:09:31 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r297 r298 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 } … … 80 80 #splitPlaneStrategy 18 81 81 # largest polygon area 82 #splitPlaneStrategy 32 83 splitPlaneStrategy 72 82 splitPlaneStrategy 32 83 # axus aligned + balanced polygons 84 #splitPlaneStrategy 72 84 85 # constructionMethod rays 85 86 constructionMethod viewCells -
trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.cpp
r297 r298 106 106 } 107 107 108 float Polygon3::GetArea() const 109 { 110 float area = 0.0f; 111 112 VertexContainer vertXY; 113 114 //-- rotate polygon to lie in xy plane 115 Vector3 v1 = mVertices[0] - mVertices[1]; 116 Vector3 v2 = mVertices[2] - mVertices[1]; 117 Vector3 n = Normalize(CrossProd(v2,v1)); 118 119 Matrix4x4 rot = GenRotation(v1, v2, n); 120 121 VertexContainer::const_iterator it, it_end = mVertices.end(); 122 123 Debug << "old: "; 124 for (it = mVertices.begin(); it != it_end; ++it) 125 { 126 vertXY.push_back(rot * (*it)); 127 Debug << (*it).z << " "; 128 } 129 Debug << endl << "new: "; 130 for (it = vertXY.begin(); it != vertXY.end(); ++it) 131 Debug << (*it).z << " "; 132 Debug << endl << endl; 133 134 return area; 135 } 136 108 137 int Polygon3::Side(const Plane3 &plane) const 109 138 { -
trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.h
r295 r298 40 40 */ 41 41 void Split(Plane3 *partition, Polygon3 *front, Polygon3 *back); 42 43 /** Returns the area of this polygon. 44 */ 45 float GetArea() const; 42 46 43 47 enum {BACK_SIDE, FRONT_SIDE, SPLIT, COINCIDENT}; -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r297 r298 800 800 float sumBalancedPolys = 0; 801 801 float sumBalancedViewCells = 0; 802 float sumLeastSplits = 0; 802 float sumSplits = 0; 803 float sumPolyArea = 0; 803 804 float verticalAxis = 0; 804 805 … … 825 826 826 827 if (sSplitPlaneStrategy & LEAST_SPLITS) 827 sumLeastSplits += sLeastSplitsTable[classification]; 828 sumSplits += sLeastSplitsTable[classification]; 829 830 if (sSplitPlaneStrategy & LARGEST_POLY_AREA) 831 sumPolyArea += (*it)->GetArea(); 828 832 } 829 833 } … … 881 885 return sBalancedPolysFactor * fabs(sumBalancedPolys) + 882 886 sBalancedViewCellsFactor * fabs(sumBalancedViewCells) + 883 sLeastSplitsFactor * sumLeastSplits + 884 sVerticalSplitsFactor * verticalAxis; 887 sLeastSplitsFactor * sumSplits + 888 sVerticalSplitsFactor * verticalAxis + 889 sumPolyArea; 885 890 } 886 891
Note: See TracChangeset
for help on using the changeset viewer.