Changeset 2000 for GTP


Ignore:
Timestamp:
01/20/07 00:29:03 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

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

    r1999 r2000  
    1616{ 
    1717   
    18 #define GVS_DEBUG 1 
     18#define GVS_DEBUG 0 
    1919 
    2020struct VizStruct 
     
    3131GvsPreprocessor::GvsPreprocessor():  
    3232Preprocessor(),  
    33 //mSamplingType(SamplingStrategy::VIEWCELL_BASED_DISTRIBUTION), 
    34 mSamplingType(SamplingStrategy::DIRECTION_BASED_DISTRIBUTION), 
     33mSamplingType(SamplingStrategy::VIEWCELL_BASED_DISTRIBUTION), 
     34//mSamplingType(SamplingStrategy::DIRECTION_BASED_DISTRIBUTION), 
    3535mProcessedViewCells(0), 
    3636mCurrentViewCell(NULL) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r1999 r2000  
    750750        Vector3 normal, normal2; 
    751751         
    752         float r[1]; 
    753         sHalton.GetNext(1, r); 
    754  
    755         const int objIdx = (int)(r[0] * (float)mPreprocessor.mObjects.size() - 1.0f); 
    756                                 //      = (int)RandomValue(0, (float)mPreprocessor.mObjects.size() - 0.5f); 
    757         Intersectable *object = mPreprocessor.mObjects[objIdx]; 
    758  
    759         //cout << "obj: " << objIdx << endl; 
    760  
    761         object->GetRandomSurfacePoint(point, normal); 
     752        // float r[1]; 
     753        // sHalton.GetNext(1, r); 
     754        // const int objIdx = (int)(r[0] * (float)mPreprocessor.mObjects.size() - 1.0f); 
     755        // Intersectable *object = mPreprocessor.mObjects[objIdx]; 
     756        // object->GetRandomSurfacePoint(point, normal); 
     757        // cout << "obj: " << objIdx << endl; 
     758 
     759        float r[2]; 
     760        sHalton.GetNext(2, r); 
     761 
     762        direction = UniformRandomVector(r[0], r[1]); 
     763        const float c = Magnitude(direction); 
     764 
     765    if (c <= Limits::Small)  
     766                return false; 
     767 
     768        direction *= 1.0f / c; 
     769 
     770        // get point on view cell surface 
    762771        mViewCell->GetRandomSurfacePoint(origin, normal2); 
    763772 
    764         direction = point - origin; 
     773        //direction = point - origin; 
    765774 
    766775        // move a little bit back to avoid piercing through walls 
     
    769778 
    770779        // $$ jb the pdf is yet not correct for all sampling methods! 
    771         const float c = Magnitude(direction); 
    772  
    773         if ((c <= Limits::Small) /*|| (DotProd(direction, normal) < 0)*/) 
    774         { 
    775                 return false; 
    776         } 
    777  
    778         // $$ jb the pdf is yet not correct for all sampling methods! 
    779780        const float pdf = 1.0f; 
    780781 
    781         direction *= 1.0f / c; 
    782782        ray = SimpleRay(origin, direction, VIEWCELL_BASED_DISTRIBUTION, pdf); 
    783783 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h

    r1995 r2000  
    271271private: 
    272272 
    273   virtual bool GenerateSample(SimpleRay &ray) { return false; } 
     273  virtual bool GenerateSample(SimpleRay &ray); 
    274274 
    275275        ViewCell *mViewCell; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r1982 r2000  
    194194                                OptimizeForWindowsApplication="TRUE" 
    195195                                AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface" 
    196                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT" 
     196                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT3" 
    197197                                RuntimeLibrary="2" 
    198198                                RuntimeTypeInfo="TRUE" 
Note: See TracChangeset for help on using the changeset viewer.