Changeset 1002 for GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
- Timestamp:
- 06/07/06 10:59:55 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r931 r1002 22 22 VssPreprocessor::VssPreprocessor(): 23 23 mPass(0), 24 mVssRays() 24 mVssRays(), 25 mViewSpaceBox(NULL) 25 26 { 26 27 // this should increase coherence of the samples … … 543 544 544 545 545 AxisAlignedBox3 *box = new AxisAlignedBox3(mKdTree->GetBox());546 AxisAlignedBox3 box(mKdTree->GetBox()); 546 547 547 548 if (!useViewspacePlane) { 548 549 float size = 0.05f; 549 550 float s = 0.5f - size; 550 float olds = Magnitude(box ->Size());551 box ->Enlarge(box->Size()*Vector3(-s));551 float olds = Magnitude(box.Size()); 552 box.Enlarge(box.Size()*Vector3(-s)); 552 553 Vector3 translation = Vector3(-olds*0.1f, 0, 0); 553 box ->SetMin(box->Min() + translation);554 box ->SetMax(box->Max() + translation);554 box.SetMin(box.Min() + translation); 555 box.SetMax(box.Max() + translation); 555 556 } else { 556 557 557 558 // sample city like heights 558 box ->SetMin(1, box->Min(1) + box->Size(1)*0.2f);559 box ->SetMax(1, box->Min(1) + box->Size(1)*0.3f);559 box.SetMin(1, box.Min(1) + box.Size(1)*0.2f); 560 box.SetMax(1, box.Min(1) + box.Size(1)*0.3f); 560 561 } 561 562 562 563 if (use2dSampling) 563 box ->SetMax(1, box->Min(1));564 box.SetMax(1, box.Min(1)); 564 565 565 566 cout<<"mUseViewSpaceBox="<<mUseViewSpaceBox<<endl; … … 570 571 if (!mEnlargeViewSpace) 571 572 { 572 mViewSpaceBox = box;573 mViewSpaceBox = new AxisAlignedBox3(box); 573 574 } 574 575 else … … 591 592 { 592 593 // $$ JB temporary 593 AxisAlignedBox3 box = *mViewSpaceBox;594 AxisAlignedBox3 tempbox = *mViewSpaceBox; 594 595 595 float s = box.Size(0);596 float s = tempbox.Size(0); 596 597 597 box.Scale(0.8f);598 box.SetMax(0, box.Max(0) + s*0.8f);599 box.SetMin(0, box.Min(0) + s*0.8f);600 *mViewSpaceBox = box;598 tempbox.Scale(0.8f); 599 tempbox.SetMax(0, box.Max(0) + s*0.8f); 600 tempbox.SetMin(0, box.Min(0) + s*0.8f); 601 *mViewSpaceBox = tempbox; 601 602 } 602 603 }
Note: See TracChangeset
for help on using the changeset viewer.