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

ray caster bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 = 
Note: See TracChangeset for help on using the changeset viewer.