Ignore:
Timestamp:
08/27/08 15:09:04 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp

    r2865 r2873  
    1919void PoissonDiscSampleGenerator::Generate(Sample2 *samples) const 
    2020{ 
     21        // this is a hacky poisson sampling generator which does random dart-throwing 
     22        // until it is not able to place any dart for a number of tries 
     23        // in this case, the required min distance is reduced 
     24        // the solution is a possion sampling with respect to the adjusted min distance 
     25        // better solutions have been proposed, i.e., using hierarchical sampling 
     26 
     27        const float maxTries = 1000; 
     28        const float f_reduction = 0.9f; 
     29 
    2130        static HaltonSequence halton; 
    2231        float r[2]; 
    2332 
    2433        // generates poisson distribution on disc 
    25         float minDist = 4.0f / sqrt((float)mNumSamples); 
     34        float minDist = 2.0f / sqrt((float)mNumSamples); 
    2635 
    2736        //cout << "minDist before= " << minDist << endl; 
     
    6675                        } 
    6776 
    68                         if (tries > 2000) 
     77                        if (tries > maxTries) 
    6978                        { 
    70                                 minDist *= 0.9f; 
     79                                minDist *= f_reduction; 
    7180                                tries = 0; 
    7281                        } 
Note: See TracChangeset for help on using the changeset viewer.