Ignore:
Timestamp:
11/18/06 23:15:55 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1763 r1765  
    166166 
    167167        object->GetRandomSurfacePoint(point, normal); 
     168         
    168169        direction = origin - point; 
    169  
    170         // $$ jb the pdf is yet not correct for all sampling methods! 
    171         const float c = Magnitude(direction); 
    172  
    173         if (c <= Limits::Small)  
    174                 return false; 
     170         
     171        // $$ jb the pdf is yet not correct for all sampling methods! 
     172        const float c = Magnitude(direction); 
     173         
     174        if ((c <= Limits::Small) || (DotProd(direction, normal) < 0)) 
     175        { 
     176                return false; 
     177        } 
    175178 
    176179        // $$ jb the pdf is yet not correct for all sampling methods! 
     
    178181        //cout << "p: " << point << " "; 
    179182        direction *= 1.0f / c; 
     183        // a little offset 
     184        point += direction * 0.01f; 
     185 
    180186        ray = SimpleRay(point, direction, pdf); 
    181187         
     
    220226} 
    221227 
     228 
    222229#if 0 
    223230bool ObjectsInteriorDistribution::GenerateSample(SimpleRay &ray) const 
Note: See TracChangeset for help on using the changeset viewer.