Changeset 576 for trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
- Timestamp:
- 01/25/06 14:35:01 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
r575 r576 435 435 { 436 436 Vector3 origin, direction; 437 438 for (int i=0; rays.size() < number; i++) { 439 mViewCellsManager->GetViewPoint(origin); 440 437 int startSize = rays.size(); 438 for (int i=0; rays.size() - startSize < number; i++) { 441 439 // now get the direction 442 440 switch (sampleType) { 443 441 case OBJECT_BASED_DISTRIBUTION: { 442 mViewCellsManager->GetViewPoint(origin); 444 443 Vector3 point; 445 444 Vector3 normal; … … 450 449 } 451 450 break; 451 case OBJECT_DIRECTION_BASED_DISTRIBUTION: { 452 int i = RandomValue(0, mObjects.size() - 1); 453 Intersectable *object = mObjects[i]; 454 Vector3 normal; 455 object->GetRandomSurfacePoint(origin, normal); 456 direction = UniformRandomVector(normal); 457 origin += 0.1f*direction; 458 } 459 break; 452 460 case DIRECTION_BASED_DISTRIBUTION: 461 mViewCellsManager->GetViewPoint(origin); 453 462 direction = UniformRandomVector(); 454 463 break; 455 464 case DIRECTION_BOX_BASED_DISTRIBUTION: { 465 mViewCellsManager->GetViewPoint(origin); 456 466 float alpha = RandomValue(0.0f, 2*M_PI); 457 467 float beta = RandomValue(-M_PI/2, M_PI/2); … … 460 470 } 461 471 case SPATIAL_BOX_BASED_DISTRIBUTION: 472 mViewCellsManager->GetViewPoint(origin); 462 473 direction = mKdTree->GetBox().GetRandomPoint() - origin; 463 474 break;
Note: See TracChangeset
for help on using the changeset viewer.