Ignore:
Timestamp:
11/25/05 17:16:26 (19 years ago)
Author:
mattausch
Message:

bsptree view cells working in VssPreprocessor?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp

    r434 r436  
    440440  cout << "#totalRayStackSize=" << mVssRays.size() << endl <<flush; 
    441441         
    442   int numExportRays = 10000; 
    443   //int numExportRays = 0; 
     442  //int numExportRays = 10000; 
     443  int numExportRays = 0; 
    444444 
    445445  if (numExportRays) { 
     
    451451  //-- construct BSP view cells 
    452452  if (ViewCell::sHierarchy == ViewCell::BSP)  
    453         { 
     453  { 
    454454          const int bspSamples = min((int)mVssRays.size(), mBspConstructionSamples); 
    455455                 
     456          Debug << "bpssamples: " << bspSamples << endl; 
    456457          for (int i = 0; i < bspSamples; ++ i) 
    457                 bspRays.push_back(new Ray(*mVssRays[i])); 
    458  
     458                  bspRays.push_back(new Ray(*mVssRays[i])); 
     459          
    459460          //-- construct BSP tree using the samples 
    460461          mBspTree = new BspTree(&mUnbounded);   
    461462 
     463          ObjectContainer objects; 
     464          mSceneGraph->CollectObjects(&objects); 
     465           
    462466          mBspTree->SetGenerateViewCells(true); 
    463           mBspTree->Construct(bspRays); 
    464  
    465           Exporter *exporter = Exporter::GetExporter("vccbsprays.x3d"); 
    466                          
    467           // export rays piercing this view cell 
    468           exporter->ExportRays(bspRays, 1000, RgbColor(0, 1, 0)); 
    469  
    470           // cast remaining initial rays into BSP tree 
    471           for (int i = bspSamples; i < (int)mVssRays.size(); ++ i) 
    472                 CastRay(*mBspTree, *mVssRays[i]); 
     467          mBspTree->Construct(objects, bspRays); 
    473468        } 
    474469 
     
    587582  //-- cast ray to BSP tree to get intersection with view cells 
    588583  Ray ray(vssRay); 
    589  
    590   Debug << ray << endl; 
    591   if (ray.intersections.empty()) 
    592         Debug << "empty ray" << endl; 
    593   else  
    594         Debug << "intersection: " << ray.intersections[0].mT << " " << ray.intersections[0].mObject << endl; 
    595  
    596584  mBspTree->CastRay(ray); 
    597585                                 
     
    601589                         
    602590  if (!ray.intersections.empty()) // second intersection found 
    603         { 
     591  { 
    604592          //sampleContributions +=  
    605593          AddObjectSamples(ray.intersections[0].mObject, ray); 
    606         } 
     594  } 
    607595} 
    608596 
Note: See TracChangeset for help on using the changeset viewer.