Changeset 2587 for GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
- Timestamp:
- 01/10/08 02:43:33 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2586 r2587 13 13 #include "BvHierarchy.h" 14 14 #include "KdTree.h" 15 #include "SamplingStrategy.h" 16 15 17 16 18 #ifdef USE_CG … … 200 202 201 203 202 void GlRenderer::RenderRays(const VssRayContainer &rays )204 void GlRenderer::RenderRays(const VssRayContainer &rays, int colorType) 203 205 { 204 206 VssRayContainer::const_iterator it = rays.begin(), it_end = rays.end(); … … 206 208 glBegin(GL_LINES); 207 209 210 float importance; 211 208 212 for (; it != it_end; ++it) 209 213 { 210 214 VssRay *ray = *it; 211 const float importance = log10(1e3*ray->mWeightedPvsContribution)/3.0f; 212 213 //glColor3f(1.0f, 0.0f, 0.0f); 214 glColor3f(importance, importance, importance); 215 216 switch (colorType) 217 { 218 case 0: 219 glColor3f(1.0f, 0.0f, 0.0f); 220 break; 221 222 case 1: 223 importance = 1.0f * ray->Length() / Magnitude(mViewCellsManager->GetViewSpaceBox().Diagonal()); 224 glColor3f(importance, importance, importance); 225 break; 226 227 case 2: 228 importance = log10(1e3 * ray->mPvsContribution) / 3.0f; 229 glColor3f(importance, importance, importance); 230 break; 231 232 case 3: 233 { 234 // nested switches ok? 235 switch (ray->mDistribution) 236 { 237 case SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION: 238 glColor3f(1, 0, 0); 239 break; 240 case SamplingStrategy::MUTATION_BASED_DISTRIBUTION: 241 glColor3f(0, 1, 0); 242 break; 243 case SamplingStrategy::DIRECTION_BASED_DISTRIBUTION: 244 glColor3f(0, 1, 1); 245 break; 246 case SamplingStrategy::OBJECT_DIRECTION_BASED_DISTRIBUTION: 247 glColor3f(1, 1, 0); 248 break; 249 } 250 } 251 } 252 215 253 glVertex3fv(&ray->mOrigin.x); 216 254 glVertex3fv(&ray->mTermination.x);
Note: See TracChangeset
for help on using the changeset viewer.