Ignore:
Timestamp:
11/28/06 19:46:36 (18 years ago)
Author:
bittner
Message:

global lines support

File:
1 edited

Legend:

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

    r1785 r1824  
    386386} 
    387387 
    388 } 
    389  
    390  
     388 
     389bool 
     390GlobalLinesDistribution::GenerateSample(SimpleRay &ray) const 
     391{ 
     392        Vector3 origin, termination, direction;  
     393         
     394        origin = mPreprocessor.mViewCellsManager->GetViewSpaceBox().GetRandomSurfacePoint(); 
     395 
     396        termination = mPreprocessor.mViewCellsManager->GetViewSpaceBox().GetRandomSurfacePoint(); 
     397         
     398        direction = termination - origin; 
     399        //direction = UniformRandomVector(); 
     400 
     401 
     402        // $$ jb the pdf is yet not correct for all sampling methods! 
     403        const float c = Magnitude(direction); 
     404        if (c <= Limits::Small)  
     405                return false; 
     406         
     407         
     408        direction *= 1.0f / c; 
     409         
     410        // a little offset 
     411        //      origin += direction * 0.001f; 
     412         
     413        // $$ jb the pdf is yet not correct for all sampling methods! 
     414        const float pdf = 1.0f; 
     415 
     416        ray = SimpleRay(origin, direction, pdf); 
     417        ray.mType = Ray::GLOBAL_RAY; 
     418        return true; 
     419} 
     420 
     421} 
     422 
     423 
Note: See TracChangeset for help on using the changeset viewer.