Changeset 2935 for GTP/trunk/App/Demos
- Timestamp:
- 09/12/08 13:50:13 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp
r2934 r2935 24 24 static Polyhedron *lightPoly = NULL; 25 25 static Vector3 dummyPt; 26 static Matrix4x4 dummyMat; 26 27 27 28 … … 187 188 glPointSize(10.0f); 188 189 190 Vector3 pt = Vector3::ZERO(); 191 192 Matrix4x4 myMat = Invert(dummyMat); 193 pt = myMat * pt; 194 189 195 glBegin(GL_POINTS); 190 glVertex3f( dummyPt.x, dummyPt.y, dummyPt.z);196 glVertex3f(pt.x, pt.y, pt.z); 191 197 glEnd(); 192 198 } … … 219 225 //-- first find the free parameter values n, and P (the projection center), and the projection depth 220 226 221 //const float n = 1e1f;222 const float n = 1e6f;227 const float n = 1e1f; 228 //const float n = 1e6f; 223 229 //const float n = ComputeN(bounds_ls) * 100; 224 230 … … 230 236 const Vector3 lsNear = lightSpace * nearPt; 231 237 232 //c start has the x and y coordinate of e, the z coord of the near plane of the light volume 238 //c start has the x and y coordinate of e, the z coord of the near plane of the light volume 239 //const Vector3 startPt = Vector3(lsNear.x, lsNear.y, bounds_ls.Max().z); 233 240 const Vector3 startPt = Vector3(lsNear.x, lsNear.y, bounds_ls.Max().z); 234 241 … … 240 247 241 248 cout <<"start: " << startPt << " " << projCenter << " " << Distance(lightSpace * mCamera->GetPosition(), startPt) << endl; 242 dummyPt = -projCenter;249 //dummyPt = -projCenter; 243 250 244 251 //construct a translation that moves to the projection center … … 421 428 //calculate a frame matrix that uses the projViewDir[lightspace] as up vector 422 429 //look(from position, into the direction of the projected direction, with unchanged up-vector) 423 const Matrix4x4 frame = MyLookAt2(Vector3::ZERO(), -projViewDir, Vector3::UNIT_Y());430 const Matrix4x4 frame = MyLookAt2(Vector3::ZERO(), -projViewDir, -Vector3::UNIT_Y()); 424 431 //const Matrix4x4 frame = MyLookAt(Vector3::ZERO(), projViewDir, Vector3::UNIT_Z()); 425 432 … … 611 618 mShadowCam->SetupCameraView(); 612 619 620 dummyMat = mLightProjView; 621 613 622 614 623 ////////////// … … 696 705 mLightProjView = lightView * lightProj; 697 706 698 //dummy= mLightProjView;707 dummyMat = mLightProjView; 699 708 700 709 DEL_PTR(lightPoly);
Note: See TracChangeset
for help on using the changeset viewer.