Changeset 1765 for GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
- Timestamp:
- 11/18/06 23:15:55 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1763 r1765 166 166 167 167 object->GetRandomSurfacePoint(point, normal); 168 168 169 direction = origin - point; 169 170 // $$ jb the pdf is yet not correct for all sampling methods! 171 const float c = Magnitude(direction); 172 173 if (c <= Limits::Small) 174 return false; 170 171 // $$ jb the pdf is yet not correct for all sampling methods! 172 const float c = Magnitude(direction); 173 174 if ((c <= Limits::Small) || (DotProd(direction, normal) < 0)) 175 { 176 return false; 177 } 175 178 176 179 // $$ jb the pdf is yet not correct for all sampling methods! … … 178 181 //cout << "p: " << point << " "; 179 182 direction *= 1.0f / c; 183 // a little offset 184 point += direction * 0.01f; 185 180 186 ray = SimpleRay(point, direction, pdf); 181 187 … … 220 226 } 221 227 228 222 229 #if 0 223 230 bool ObjectsInteriorDistribution::GenerateSample(SimpleRay &ray) const
Note: See TracChangeset
for help on using the changeset viewer.