Changeset 1765 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 11/18/06 23:15:55 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1764 r1765 316 316 317 317 // create one third of each type 318 int stype; 319 320 const int numStrategies = 3; 321 322 stype = SamplingStrategy::OBJECT_BASED_DISTRIBUTION; 323 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 324 325 stype = SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION; 326 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 327 328 if (0) 329 { 330 stype = SamplingStrategy::DIRECTION_BASED_DISTRIBUTION; 331 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 332 } 333 334 stype = SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION; 335 mPreprocessor->GenerateRays(samplesPerPass / numStrategies, sampleType, simpleRays); 318 int castRays = 0; 319 320 vector<int> strategies; 321 322 strategies.push_back(SamplingStrategy::OBJECT_BASED_DISTRIBUTION); 323 strategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 324 strategies.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION); 325 326 const int numRaysPerPass = samplesPerPass / (int)strategies.size(); 327 328 vector<int>::const_iterator iit, iit_end = strategies.end(); 329 330 for (iit = strategies.begin(); iit != iit_end; ++ iit) 331 { 332 int stype = *iit; 333 const int newRays = 334 mPreprocessor->GenerateRays(numRaysPerPass, stype, simpleRays); 335 336 cout << "cast " << newRays << " rays of strategy " << stype << endl; 337 castRays += newRays; 338 } 336 339 337 340 cout << "generated " << samplesPerPass << " samples in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; … … 2708 2711 if (vcValid) 2709 2712 { 2710 m.mDiffuseColor.r = 0. 5f + RandomValue(0.0f, 0.5f);2711 m.mDiffuseColor.g = 0. 5f + RandomValue(0.0f, 0.5f);2712 m.mDiffuseColor.b = 0. 5f + RandomValue(0.f, 0.5f);2713 m.mDiffuseColor.r = 0.2f + RandomValue(0.0f, 0.8f); 2714 m.mDiffuseColor.g = 0.2f + RandomValue(0.0f, 0.8f); 2715 m.mDiffuseColor.b = 0.2f + RandomValue(0.0f, 0.8f); 2713 2716 } 2714 2717 else … … 2753 2756 // special color code for invalid view cells 2754 2757 m.mDiffuseColor.r = importance; 2755 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r;2756 m.mDiffuseColor.b = vcValid ? 1.0f : 0.0f;2758 m.mDiffuseColor.g = vcValid ? 0.0f : 1.0f; 2759 m.mDiffuseColor.b = 1.0f - importance; 2757 2760 2758 2761 //Debug << "importance: " << importance << endl; … … 5435 5438 Exporter *exporter = Exporter::GetExporter("final_view_cells.wrl"); 5436 5439 5437 Vector3 scale( 1.0f, 0.9f, 1.0f);5440 Vector3 scale(0.9f, 0.9f, 0.9f); 5438 5441 if (exporter) 5439 5442 {
Note: See TracChangeset
for help on using the changeset viewer.