Ignore:
Timestamp:
03/05/07 11:07:44 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2116 r2187  
    5252        // terminate the whole method? 
    5353        for (; i < number; i++)  
    54           { 
     54        { 
    5555                int j = 0; 
    5656                bool sampleGenerated = false; 
    57                  
     57 
    5858                for (j = 0; !sampleGenerated && (j < maxTries); ++ j) 
    59                   { 
     59                { 
    6060                        sampleGenerated = GenerateSample(ray); 
    61                          
     61 
    6262                        if (sampleGenerated) 
    63                           {              
     63                        {                
    6464                                ++ samples; 
    6565                                rays.push_back(ray); 
    66                           } 
    67                   } 
    68           } 
    69  
    70  
    71          
     66                        } 
     67                } 
     68        } 
    7269 
    7370        return samples; 
     
    313310        return true; 
    314311} 
    315  
    316  
    317 #if 0 
    318 bool ObjectsInteriorDistribution::GenerateSample(SimpleRay &ray) 
    319 { 
    320         Vector3 origin, direction;  
    321  
    322         // get random object 
    323         const int i = RandomValue(0, mPreprocessor.mObjects.size() - 1); 
    324  
    325         const Intersectable *obj = mPreprocessor.mObjects[i]; 
    326  
    327         // note: if we load the polygons as meshes,  
    328         // asymtotically every second sample is lost! 
    329         origin = obj->GetBox().GetRandomPoint(); 
    330  
    331         // uniformly distributed direction 
    332         direction = UniformRandomVector(); 
    333  
    334         const float c = Magnitude(direction); 
    335  
    336         if (c <= Limits::Small)  
    337                 return false; 
    338  
    339         const float pdf = 1.0f; 
    340  
    341         direction *= 1.0f / c; 
    342         ray = SimpleRay(origin, direction, pdf); 
    343  
    344         return true; 
    345 } 
    346  
    347 #endif 
    348312 
    349313 
Note: See TracChangeset for help on using the changeset viewer.