- Timestamp:
- 01/20/07 00:29:03 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r1999 r2000 16 16 { 17 17 18 #define GVS_DEBUG 118 #define GVS_DEBUG 0 19 19 20 20 struct VizStruct … … 31 31 GvsPreprocessor::GvsPreprocessor(): 32 32 Preprocessor(), 33 //mSamplingType(SamplingStrategy::VIEWCELL_BASED_DISTRIBUTION),34 mSamplingType(SamplingStrategy::DIRECTION_BASED_DISTRIBUTION),33 mSamplingType(SamplingStrategy::VIEWCELL_BASED_DISTRIBUTION), 34 //mSamplingType(SamplingStrategy::DIRECTION_BASED_DISTRIBUTION), 35 35 mProcessedViewCells(0), 36 36 mCurrentViewCell(NULL) -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1999 r2000 750 750 Vector3 normal, normal2; 751 751 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 762 771 mViewCell->GetRandomSurfacePoint(origin, normal2); 763 772 764 direction = point - origin;773 //direction = point - origin; 765 774 766 775 // move a little bit back to avoid piercing through walls … … 769 778 770 779 // $$ 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!779 780 const float pdf = 1.0f; 780 781 781 direction *= 1.0f / c;782 782 ray = SimpleRay(origin, direction, VIEWCELL_BASED_DISTRIBUTION, pdf); 783 783 -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r1995 r2000 271 271 private: 272 272 273 virtual bool GenerateSample(SimpleRay &ray) { return false; }273 virtual bool GenerateSample(SimpleRay &ray); 274 274 275 275 ViewCell *mViewCell; -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r1982 r2000 194 194 OptimizeForWindowsApplication="TRUE" 195 195 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(QTDIR)\include\QtOpenGl";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtCore";"$(QTDIR)\include";QtInterface" 196 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT "196 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT3" 197 197 RuntimeLibrary="2" 198 198 RuntimeTypeInfo="TRUE"
Note: See TracChangeset
for help on using the changeset viewer.