- Timestamp:
- 01/19/06 23:36:01 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r556 r557 139 139 140 140 141 float ViewCellsManager::GetViewSpaceVolume() 142 { 143 return mViewSpaceBox.GetVolume()*(2.0f*sqr(M_PI)); 144 } 145 146 141 147 bool ViewCellsManager::ViewPointValid(const Vector3 &viewPoint) const 142 148 { … … 428 434 //hray.Init(ray.GetOrigin(), ray.GetDir(), Ray::LINE_SEGMENT); 429 435 if (!GetViewSpaceBox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) 430 return;436 return; 431 437 432 438 Vector3 origin = hray.Extrap(tmin); … … 679 685 { 680 686 // compute view cell area as subsititute for probability 681 #if 0682 return Get Area(viewCell) / GetViewSpaceBox().SurfaceArea();687 #if 1 688 return GetVolume(viewCell) / GetViewSpaceBox().GetVolume(); 683 689 #else 684 690 return GetArea(viewCell) / GetAccVcArea(); … … 835 841 cout << "exporting view cells after merge ... "; 836 842 Exporter *exporter = Exporter::GetExporter("merged_view_cells.x3d"); 843 837 844 838 845 if (exporter) … … 1888 1895 VssRayContainer savedRays; 1889 1896 1890 Debug << "construction samples: " << mConstructionSamples << " rays: " << rays.size() << endl;1897 Debug << "construction samples: " << mConstructionSamples << " rays: " << (int)rays.size() << endl; 1891 1898 GetRaySets(rays, mConstructionSamples, constructionRays, &savedRays); 1892 1899 … … 2176 2183 exporter->ExportRays(visRays, RgbColor(0, 1, 0)); 2177 2184 } 2178 2185 2179 2186 ExportViewCellsForViz(exporter); 2180 2187 delete exporter; 2181 2188 } 2189 } 2190 2191 // export shuffled view cells 2192 if (1) 2193 { 2194 cout << "exporting shuffled view cells ..."; 2195 2196 Exporter *exporter = Exporter::GetExporter("shuffled_view_cells.x3d"); 2197 if (exporter) 2198 { 2199 if (1) 2200 { 2201 exporter->SetWireframe(); 2202 exporter->ExportBox(mViewSpaceBox); 2203 exporter->SetFilled(); 2204 } 2205 2206 if (mExportGeometry) 2207 { 2208 exporter->ExportGeometry(objects); 2209 } 2210 2211 ViewCellContainer::const_iterator vit, vit_end = mViewCells.end(); 2212 2213 Material vm, lm; 2214 2215 for (vit = mViewCells.begin(); vit != mViewCells.end(); ++ vit) 2216 { 2217 BspViewCell *vc = dynamic_cast<BspViewCell *>(*vit); 2218 2219 vm = RandomMaterial(); 2220 2221 lm = vm; 2222 2223 vm.mDiffuseColor.r -= 0.3f; 2224 vm.mDiffuseColor.g -= 0.3f; 2225 vm.mDiffuseColor.b -= 0.3f; 2226 2227 vector<BspLeaf *>::const_iterator lit, lit_end = vc->mLeaves.end(); 2228 2229 for (lit = vc->mLeaves.begin(); lit != lit_end; ++ lit) 2230 { 2231 BspLeaf *leaf = *lit; 2232 2233 if (leaf->Mailed()) 2234 exporter->SetForcedMaterial(lm); 2235 else 2236 exporter->SetForcedMaterial(vm); 2237 2238 BspNodeGeometry geom; 2239 mVspBspTree->ConstructGeometry(leaf, geom); 2240 exporter->ExportPolygons(geom.mPolys); 2241 } 2242 } 2243 2244 delete exporter; 2245 } 2246 2182 2247 2183 2248 cout << "finished" << endl; … … 2375 2440 importance = (float)bspVc->mLeaves.size() / 2376 2441 (float)mViewCellsStats.maxLeaves; 2377 2378 if (CheckValid(vc))2379 m.mDiffuseColor.b = 1.0f;2380 m.mDiffuseColor.r = importance;2381 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r;2382 2442 } 2383 2443 break; … … 2387 2447 (float)(mVspBspTree->GetStatistics().maxDepth * 2); 2388 2448 2389 if (CheckValid(vc))2390 m.mDiffuseColor.b = 1.0f;2391 m.mDiffuseColor.r = importance;2392 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r;2393 2449 } 2394 2450 break;
Note: See TracChangeset
for help on using the changeset viewer.