Changeset 545 for trunk/VUT/GtpVisibilityPreprocessor
- Timestamp:
- 01/17/06 00:28:06 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r544 r545 30 30 samplesPerPass 100000 31 31 initialSamples 300000 32 vssSamples 1 00000032 vssSamples 1200000 33 33 vssSamplesPerPass 100000 34 34 useImportanceSampling true … … 259 259 VspBspTree { 260 260 Construction { 261 samples 600000261 samples 100000 262 262 epsilon 0.005 263 263 randomize false … … 298 298 #minArea 0.0001 299 299 minArea -1 300 maxRayContribution 0. 2300 maxRayContribution 0.3 301 301 maxCostRatio 0.9 302 302 missTolerance 3 303 303 #maxAccRayLength 100 304 304 305 maxViewCells 6001305 maxViewCells 501 306 306 307 307 # used for pvs criterium -
trunk/VUT/GtpVisibilityPreprocessor/src/AxisAlignedBox3.cpp
r542 r545 2038 2038 polys.push_back(face1); 2039 2039 2040 face1->mVertices.push_back(Vector3(mMin.x, mMin.y,mMax.z));2041 face1->mVertices.push_back(Vector3(mMin.x, mMax.y,mMax.z));2042 face1->mVertices.push_back(Vector3(mMin.x, mMax.y,mMin.z));2043 face1->mVertices.push_back(Vector3(mMin.x, mMin.y,mMin.z));2040 face1->mVertices.push_back(Vector3(mMin.x, mMin.y, mMax.z)); 2041 face1->mVertices.push_back(Vector3(mMin.x, mMax.y, mMax.z)); 2042 face1->mVertices.push_back(Vector3(mMin.x, mMax.y ,mMin.z)); 2043 face1->mVertices.push_back(Vector3(mMin.x, mMin.y, mMin.z)); 2044 2044 2045 2045 Polygon3 *face2 = new Polygon3(); 2046 2046 polys.push_back(face2); 2047 2048 face2->mVertices.push_back(Vector3(mMax.x, mMin.y,mMin.z));2049 face2->mVertices.push_back(Vector3(mMax.x, mMax.y,mMin.z));2050 face2->mVertices.push_back(Vector3(mMax.x, mMax.y,mMax.z));2051 face2->mVertices.push_back(Vector3(mMax.x, mMin.y,mMax.z));2047 2048 face2->mVertices.push_back(Vector3(mMax.x, mMin.y, mMin.z)); 2049 face2->mVertices.push_back(Vector3(mMax.x, mMax.y, mMin.z)); 2050 face2->mVertices.push_back(Vector3(mMax.x, mMax.y, mMax.z)); 2051 face2->mVertices.push_back(Vector3(mMax.x, mMin.y, mMax.z)); 2052 2052 2053 2053 Polygon3 *face3 = new Polygon3(); 2054 2054 polys.push_back(face3); 2055 2055 2056 face3->mVertices.push_back(Vector3(mMax.x, mMin.y,mMin.z));2057 face3->mVertices.push_back(Vector3(mMax.x, mMin.y,mMax.z));2058 face3->mVertices.push_back(Vector3(mMin.x, mMin.y,mMax.z));2059 face3->mVertices.push_back(Vector3(mMin.x, mMin.y,mMin.z));2056 face3->mVertices.push_back(Vector3(mMax.x, mMin.y ,mMin.z)); 2057 face3->mVertices.push_back(Vector3(mMax.x, mMin.y, mMax.z)); 2058 face3->mVertices.push_back(Vector3(mMin.x, mMin.y, mMax.z)); 2059 face3->mVertices.push_back(Vector3(mMin.x, mMin.y, mMin.z)); 2060 2060 2061 2061 Polygon3 *face4 = new Polygon3(); 2062 2062 polys.push_back(face4); 2063 2063 2064 face4->mVertices.push_back(Vector3(mMin.x, mMax.y,mMin.z));2065 face4->mVertices.push_back(Vector3(mMin.x, mMax.y,mMax.z));2066 face4->mVertices.push_back(Vector3(mMax.x, mMax.y,mMax.z));2067 face4->mVertices.push_back(Vector3(mMax.x, mMax.y,mMin.z));2064 face4->mVertices.push_back(Vector3(mMin.x, mMax.y, mMin.z)); 2065 face4->mVertices.push_back(Vector3(mMin.x, mMax.y, mMax.z)); 2066 face4->mVertices.push_back(Vector3(mMax.x, mMax.y, mMax.z)); 2067 face4->mVertices.push_back(Vector3(mMax.x, mMax.y, mMin.z)); 2068 2068 2069 2069 Polygon3 *face5 = new Polygon3(); 2070 2070 polys.push_back(face5); 2071 2071 2072 face5->mVertices.push_back(Vector3(mMin.x, mMax.y,mMin.z));2073 face5->mVertices.push_back(Vector3(mMax.x, mMax.y,mMin.z));2074 face5->mVertices.push_back(Vector3(mMax.x, mMin.y,mMin.z));2075 face5->mVertices.push_back(Vector3(mMin.x, mMin.y,mMin.z));2072 face5->mVertices.push_back(Vector3(mMin.x, mMax.y, mMin.z)); 2073 face5->mVertices.push_back(Vector3(mMax.x, mMax.y, mMin.z)); 2074 face5->mVertices.push_back(Vector3(mMax.x, mMin.y, mMin.z)); 2075 face5->mVertices.push_back(Vector3(mMin.x, mMin.y, mMin.z)); 2076 2076 2077 2077 Polygon3 *face6 = new Polygon3(); 2078 2078 polys.push_back(face6); 2079 2079 2080 face6->mVertices.push_back(Vector3(mMin.x, mMin.y,mMax.z));2081 face6->mVertices.push_back(Vector3(mMax.x, mMin.y,mMax.z));2082 face6->mVertices.push_back(Vector3(mMax.x, mMax.y,mMax.z));2083 face6->mVertices.push_back(Vector3(mMin.x, mMax.y,mMax.z));2084 } 2080 face6->mVertices.push_back(Vector3(mMin.x, mMin.y, mMax.z)); 2081 face6->mVertices.push_back(Vector3(mMax.x, mMin.y, mMax.z)); 2082 face6->mVertices.push_back(Vector3(mMax.x, mMax.y, mMax.z)); 2083 face6->mVertices.push_back(Vector3(mMin.x, mMax.y, mMax.z)); 2084 } -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r544 r545 1167 1167 } 1168 1168 1169 1169 1170 Plane3 BspTree::SelectPlane(BspLeaf *leaf, BspTraversalData &data) 1170 1171 { … … 1553 1554 } 1554 1555 1555 bool useRand; ;1556 bool useRand; 1556 1557 int limit; 1557 1558 … … 2559 2560 PolygonContainer::const_iterator pit, pit_end = mPolys.end(); 2560 2561 2562 // note: can take arbitrary point, e.g., the origin. However, 2563 // center of mass prevents precision errors 2564 const Vector3 center = CenterOfMass(); 2565 2561 2566 for (pit = mPolys.begin(); pit != pit_end; ++ pit) 2562 2567 { 2563 2568 Polygon3 *poly = *pit; 2564 const Vector3 v = poly->mVertices[0];2569 const Vector3 v0 = poly->mVertices[0] - center; 2565 2570 2566 2571 for (int i = 1; i < (int)poly->mVertices.size() - 1; ++ i) 2567 2572 { 2568 volume += f * (DotProd(v, 2569 CrossProd(poly->mVertices[i], poly->mVertices[i + 1]))); 2570 } 2571 } 2572 2573 Debug << "volume: " << volume << endl; 2573 const Vector3 v1 = poly->mVertices[i] - center; 2574 const Vector3 v2 = poly->mVertices[i + 1] - center; 2575 2576 volume += f * (DotProd(v0, CrossProd(v1, v2))); 2577 } 2578 } 2579 2574 2580 return volume; 2575 2581 } 2576 2582 2577 2583 2578 Vector3 BspNodeGeometry::C omputeMassCenter() const2584 Vector3 BspNodeGeometry::CenterOfMass() const 2579 2585 { 2580 2586 int n = 0; -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r544 r545 61 61 /** Computes mass center of bsp node geometry. 62 62 */ 63 Vector3 ComputeMassCenter() const; 63 Vector3 CenterOfMass() const; 64 64 65 /** The polygons the geometry consists of. 65 66 */ -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r544 r545 605 605 mEpsilon); 606 606 607 frontData.mArea = frontData.mGeometry->GetArea(); 608 backData.mArea = backData.mGeometry->GetArea(); 607 //frontData.mArea = frontData.mGeometry->GetArea(); 608 //backData.mArea = backData.mGeometry->GetArea(); 609 frontData.mArea = frontData.mGeometry->GetVolume(); 610 backData.mArea = backData.mGeometry->GetVolume(); 609 611 } 610 612 } … … 851 853 int bestAxis = -1; 852 854 853 // create bounding box of node extent855 // create bounding box of node geometry 854 856 AxisAlignedBox3 box; 855 857 box.Initialize(); … … 877 879 nBackGeom[axis] = new BspNodeGeometry(); 878 880 879 if (!mOnlyDrivingAxis || axis == sAxis)881 if (!mOnlyDrivingAxis || (axis == sAxis)) 880 882 { 881 883 if (!useCostHeuristics) … … 894 896 895 897 pos = box.Max(); pos[axis] = nPosition[axis]; 896 AxisAlignedBox3 backBox(box.Min(), pos);898 const AxisAlignedBox3 backBox(box.Min(), pos); 897 899 backBox.ExtractPolys(nBackGeom[axis]->mPolys); 898 900 899 901 pos = box.Min(); pos[axis] = nPosition[axis]; 900 AxisAlignedBox3 frontBox(pos, box.Max());902 const AxisAlignedBox3 frontBox(pos, box.Max()); 901 903 frontBox.ExtractPolys(nFrontGeom[axis]->mPolys); 902 904 … … 1107 1109 // we can do this because we always save the 1108 1110 // computed values from the axis aligned splits 1109 /*frontData.mGeometry = fGeom;1111 frontData.mGeometry = fGeom; 1110 1112 backData.mGeometry = bGeom; 1111 1113 frontData.mArea = fArea; 1112 1114 backData.mArea = bArea; 1113 */ 1115 1114 1116 //! error also computed if cost ratio is missed 1115 1117 ++ mStat.splits[axis]; … … 1301 1303 mBox, 1302 1304 mEpsilon); 1303 #if 0 1304 AxisAlignedBox3 fbox; 1305 AxisAlignedBox3 bbox; 1306 AxisAlignedBox3 box; 1307 fbox.Initialize(); 1308 bbox.Initialize(); 1309 box.Initialize(); 1310 1311 geomFront.IncludeInBox(fbox); 1312 geomBack.IncludeInBox(bbox); 1313 data.mGeometry->IncludeInBox(box); 1314 1315 areaFront = fbox.GetVolume(); 1316 areaBack = bbox.GetVolume(); 1317 1318 pOverall = box.GetVolume(); 1319 #else 1320 areaFront = geomFront.GetArea(); 1321 areaBack = geomBack.GetArea(); 1305 1306 1307 pFront = geomFront.GetVolume(); 1308 pBack = geomBack.GetVolume(); 1309 //areaFront = geomFront.GetArea(); 1310 //areaBack = geomBack.GetArea(); 1322 1311 1323 1312 pOverall = data.mArea; 1324 #endif 1325 pBack = areaBack; 1326 pFront = areaFront; 1313 1327 1314 } 1328 1315 else // use number of rays to approximate volume
Note: See TracChangeset
for help on using the changeset viewer.