Changeset 1829


Ignore:
Timestamp:
11/29/06 12:18:27 (17 years ago)
Author:
bittner
Message:

ray caster bug fix

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp

    r1828 r1829  
    5656        } 
    5757   
     58        mPreprocessor.SetupRay(ray, simpleRay.mOrigin, -simpleRay.mDirection); 
     59        ray.mFlags &= ~Ray::CULL_BACKFACES; 
    5860   
    5961  if (castDoubleRay && mKdTree->CastRay(ray))  
    6062                { 
    61                         mPreprocessor.SetupRay(ray, simpleRay.mOrigin, -simpleRay.mDirection); 
    62                         ray.mFlags &= ~Ray::CULL_BACKFACES; 
    6363                        hitB.mObject = ray.intersections[0].mObject; 
    6464                        hitB.mPoint = ray.Extrap(ray.intersections[0].mT); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp

    r1824 r1829  
    28342834          sumContributions += c1; 
    28352835          if (c1 > maxContribution) 
    2836                 maxContribution = c1; 
     2836                        maxContribution = c1; 
    28372837           
    28382838          //$$ 20.7. changed to sqr to pronouce higher contribution so that 
     
    28422842          sumRelContributions += c2; 
    28432843          if (c2 > maxRelContribution) 
    2844                 maxRelContribution = c2; 
     2844                        maxRelContribution = c2; 
    28452845 
    28462846          //sumWeights += weight; 
     
    28502850        float distImportance = 0.0f; 
    28512851 
     2852        float spatialArea = GetBBox(leaf).SurfaceArea(); 
     2853        float dirArea = GetDirBBox(leaf).SurfaceArea(); 
    28522854        if (leaf->rays.size()) { 
    28532855          // compute average length of the ray  
    28542856          float avgLength = sumLength/leaf->rays.size(); 
    28552857          // compute estimated area of the visible surface corresponding to these rays 
    2856           float ss = GetBBox(leaf).SurfaceArea()/2.0f; 
    2857           float sd = GetDirBBox(leaf).SurfaceArea(); 
     2858          float ss = spatialArea/2.0f; 
     2859          float sd = dirArea; 
    28582860          float s = ss + avgLength*(2*sqrt(ss*sd) + avgLength*sd); 
    28592861           
     
    28642866        // sumWeights = leaf->mTotalRays; 
    28652867 
     2868        //$$ test 30.11. 2006  
     2869        // normalize per volume of the cell not the number of rays! 
     2870        sumWeights = spatialArea*dirArea; 
     2871         
    28662872        if (sumWeights != 0.0f) { 
    28672873          leaf->mImportance = 
  • GTP/trunk/Lib/Vis/Preprocessing/src/run_test2

    r1824 r1829  
    4242$COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 
    4343 -rss_use_importance+ -rss_update_subdivision+ -rss_split=hybrid -hybrid_depth=10 \ 
    44  -view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-i-combined-update-ccb12-n.log \ 
    45 -preprocessor_histogram_file=$PREFIX-i-combined-update-ccb12-n.hlog 
     44 -view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-i-combined-update-ccb12-nn.log \ 
     45-preprocessor_histogram_file=$PREFIX-i-combined-update-ccb12-nn.hlog 
    4646 
    4747 
Note: See TracChangeset for help on using the changeset viewer.