Changeset 1769 for GTP/trunk/Lib/Vis
- Timestamp:
- 11/20/06 11:35:26 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r1768 r1769 802 802 803 803 // get random edge of face (hack: this is not uniform in the edges! 804 const int edgeIdx = (int)RandomValue(0.0f, face->mVertexIndices.size() - 0.5f); 805 804 const int edgeIdx = (int)RandomValue(0.0f, (float)face->mVertexIndices.size() - 0.5f); 805 806 //cout << "idx = " << edgeIdx << " s: " << face->mVertexIndices.size() << endl; 806 807 const int vertexIdxA = face->mVertexIndices[edgeIdx]; 807 808 const int vertexIdxB = face->mVertexIndices[(edgeIdx + 1) % (int)face->mVertexIndices.size()]; … … 815 816 point = a * w + b * (1.0f - w); 816 817 818 //cout << "va " << a << " vb " << b << "p " << point << endl; 817 819 // hack: set normal of face as normal 818 820 normal = mMesh->GetFacePlane(faceIdx).mNormal; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1768 r1769 986 986 case SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION: 987 987 return new ReverseObjectBasedDistribution(*this); 988 case SamplingStrategy::VIEWCELL_BORDER_BASED_DISTRIBUTION: 989 return new ViewCellBorderBasedDistribution(*this); 988 990 //case OBJECTS_INTERIOR_DISTRIBUTION: 989 991 // return new ObjectsInteriorDistribution(*this); -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1768 r1769 199 199 Vector3 normal, normal2; 200 200 201 //cout << "y";202 201 const int vcIdx = (int)RandomValue(0, (float)viewCells.size() - 0.5f); 203 202 const int objIdx = (int)RandomValue(0, (float)mPreprocessor.mObjects.size() - 0.5f); … … 206 205 ViewCell *viewCell = viewCells[vcIdx]; 207 206 207 //cout << "vc: " << vcIdx << endl; 208 //cout << "obj: " << objIdx << endl; 209 208 210 object->GetRandomSurfacePoint(point, normal); 209 211 viewCell->GetRandomEdgePoint(origin, normal2); … … 214 216 const float c = Magnitude(direction); 215 217 216 if ((c <= Limits::Small) || (DotProd(direction, normal) < 0))218 if ((c <= Limits::Small) /*|| (DotProd(direction, normal) < 0)*/) 217 219 { 218 220 return false; … … 224 226 direction *= 1.0f / c; 225 227 ray = SimpleRay(origin, direction, pdf); 226 228 229 //cout << "ray: " << ray.mOrigin << " " << ray.mDirection << endl; 230 227 231 return true; 228 232 } … … 258 262 return true; 259 263 } 264 260 265 #endif 261 266 } -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r1763 r1769 28 28 OBJECT_DIRECTION_BASED_DISTRIBUTION, 29 29 OBJECTS_INTERIOR_DISTRIBUTION, 30 REVERSE_OBJECT_BASED_DISTRIBUTION 30 REVERSE_OBJECT_BASED_DISTRIBUTION, 31 VIEWCELL_BORDER_BASED_DISTRIBUTION 31 32 }; 32 33 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1768 r1769 551 551 552 552 ///////////////// 553 //-- Finally, we do some visualization553 //-- Show some visualizations 554 554 555 555 if (mShowVisualization) 556 556 { 557 cout << "************************\n*********************\n"; 558 if (0) 559 { 560 strategies.clear(); 561 strategies.push_back(SamplingStrategy::VIEWCELL_BORDER_BASED_DISTRIBUTION); 562 } 563 557 564 /////////////// 558 565 //-- visualization rays, e.g., to show some samples in the scene … … 5501 5508 int leafOut; 5502 5509 Environment::GetSingleton()->GetIntValue("ViewCells.Visualization.maxOutput", leafOut); 5510 5511 const bool sortViewCells = false; 5512 const bool exportPvs = true; 5513 const bool exportRays = true; 5503 5514 const int raysOut = 100; 5504 5515 5505 ExportSingleViewCells(objects, leafOut, false, true, false, raysOut, ""); 5516 ExportSingleViewCells(objects, 5517 leafOut, 5518 sortViewCells, 5519 exportPvs, 5520 exportRays, 5521 raysOut, 5522 ""); 5506 5523 } 5507 5524 … … 5943 5960 strategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 5944 5961 strategies.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION); 5945 5962 //strategies.push_back(SamplingStrategy::VIEWCELL_BORDER_BASED_DISTRIBUTION); 5946 5963 cout << "reseting pvs ... "; 5947 5964
Note: See TracChangeset
for help on using the changeset viewer.