- Timestamp:
- 01/18/07 11:44:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.cpp
r1980 r1990 9 9 #include "SamplingStrategy.h" 10 10 11 12 11 // the devil library 13 12 #include <IL/il.h> … … 15 14 #include <IL/ilut.h> 16 15 16 #ifdef USE_CG 17 17 18 #include <Cg/cg.h> 18 19 #include <Cg/cgGL.h> 19 20 20 //#include <QtOpenGL>21 21 22 22 namespace GtpVisibilityPreprocessor { … … 659 659 660 660 const float leftDist = -0.5f * mWidth + mWidth * ((float)x + 0.5f) / mTexWidth; 661 //const float leftDist = 0.5f * mWidth - mWidth * ((float)x + 0.5f) / mTexWidth; 662 663 const float upDist = -0.5f * mWidth + mWidth * ((float)y + 0.5f) / mTexHeight; 664 //const float upDist = 0.5f * mWidth - mWidth * ((float)y + 0.5f) / mTexHeight; 661 const float upDist = -0.5f * mWidth + mWidth * ((float)y + 0.5f) / mTexHeight; 665 662 666 663 hitPoint = mViewPoint + … … 693 690 694 691 695 void GlobalLinesRenderer::ComputeBoundingQuad( float &xMin,696 float &yMin,697 float &xMax,698 float &yMax)692 void GlobalLinesRenderer::ComputeBoundingQuad(int &xMin, 693 int &yMin, 694 int &xMax, 695 int &yMax) 699 696 { 700 697 const AxisAlignedBox3 bbox = mPreprocessor->mKdTree->GetBox(); … … 704 701 m.Invert(); 705 702 706 Vector3 eye(m.x[0][0], m.x[ 0][1], m.x[0][2]);707 Vector3 up(m.x[ 1][0], m.x[1][1], m.x[1][2]);708 Vector3 left(m.x[ 2][0], m.x[2][1], m.x[2][2]);703 Vector3 eye(m.x[0][0], m.x[1][0], m.x[2][0]); 704 Vector3 up(m.x[0][0], m.x[1][1], m.x[2][1]); 705 Vector3 left(m.x[0][2], m.x[1][2], m.x[2][2]); 709 706 710 707 Vector3 boxMin(1e20f); 711 708 Vector3 boxMax(-1e20f); 712 709 713 /* for (int i = 0; i < 6; ++ i) 714 { 715 Vector3 pt; 710 for (int i = 0; i < 8; ++ i) 711 { 712 Vector3 vtx; 713 714 bbox.GetVertex(i, vtx); 715 716 Vector3 pt = vtx.x * eye + vtx.y * up + vtx.z * left; 717 716 718 // TODO 717 if (boxMin.x < pt[i].x)718 boxMin.x = pt [i].x;719 if (boxMin.x > pt.x) 720 boxMin.x = pt.x; 719 721 720 if (boxMin.y < pt[i].y) 721 boxMin.y = pt[i].y; 722 723 if (boxMin.z < pt[i].z) 724 boxMin.z = pt[i].z; 725 } 726 */ 727 xMin = boxMin.x; 728 yMin = boxMin.y; 729 730 xMax = boxMax.x; 731 yMax = boxMax.y; 722 if (boxMin.y > pt.y) 723 boxMin.y = pt.y; 724 725 if (boxMin.z > pt.z) 726 boxMin.z = pt.z; 727 728 if (boxMax.x < pt.x) 729 boxMax.x = pt.x; 730 731 if (boxMax.y < pt.y) 732 boxMax.y = pt.y; 733 734 if (boxMax.z < pt.z) 735 boxMax.z = pt.z; 736 } 737 738 cout << "xmin: " << boxMin.x << " ymin " << boxMin.y << " xmax: " << boxMax.x << " ymax: " << boxMax.y << endl; 739 740 xMin = (int)(-0.5f * mWidth + mWidth * (boxMin.x + 0.5f) / mTexWidth); 741 yMin = (int)(-0.5f * mWidth + mWidth * (boxMin.y + 0.5f) / mTexHeight); 742 xMax = (int)(-0.5f * mWidth + mWidth * (boxMax.x + 0.5f) / mTexWidth); 743 yMax = (int)(-0.5f * mWidth + mWidth * (boxMax.y + 0.5f) / mTexHeight); 732 744 } 733 745 … … 757 769 } 758 770 } 771 772 int xMin, yMin, xMax, yMax; 773 ComputeBoundingQuad(xMin, yMin, xMax, yMax); 774 775 cout << "xmin2: " << xMin << " ymin " << yMin << " xmax: " << xMax << " ymax: " << yMax << endl; 759 776 760 777 ///////////////// … … 1081 1098 } 1082 1099 1083 1084 } 1100 } 1101 1102 #endif
Note: See TracChangeset
for help on using the changeset viewer.