Changeset 2935


Ignore:
Timestamp:
09/12/08 13:50:13 (16 years ago)
Author:
mattausch
Message:

something still strange with the focussing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp

    r2934 r2935  
    2424static Polyhedron *lightPoly = NULL; 
    2525static Vector3 dummyPt; 
     26static Matrix4x4 dummyMat; 
    2627 
    2728 
     
    187188        glPointSize(10.0f); 
    188189 
     190        Vector3 pt = Vector3::ZERO(); 
     191 
     192        Matrix4x4 myMat = Invert(dummyMat); 
     193        pt = myMat * pt; 
     194 
    189195        glBegin(GL_POINTS); 
    190         glVertex3f(dummyPt.x, dummyPt.y, dummyPt.z); 
     196        glVertex3f(pt.x, pt.y, pt.z); 
    191197        glEnd(); 
    192198} 
     
    219225        //-- first find the free parameter values n, and P (the projection center), and the projection depth 
    220226 
    221         //const float n = 1e1f; 
    222         const float n = 1e6f; 
     227        const float n = 1e1f; 
     228        //const float n = 1e6f; 
    223229        //const float n = ComputeN(bounds_ls) * 100; 
    224230 
     
    230236        const Vector3 lsNear = lightSpace * nearPt; 
    231237 
    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); 
    233240        const Vector3 startPt = Vector3(lsNear.x, lsNear.y, bounds_ls.Max().z); 
    234241 
     
    240247 
    241248        cout <<"start: " << startPt << " " << projCenter << " " << Distance(lightSpace * mCamera->GetPosition(), startPt) << endl; 
    242 dummyPt = -projCenter; 
     249//dummyPt = -projCenter; 
    243250 
    244251        //construct a translation that moves to the projection center 
     
    421428        //calculate a frame matrix that uses the projViewDir[lightspace] as up vector 
    422429        //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()); 
    424431        //const Matrix4x4 frame = MyLookAt(Vector3::ZERO(), projViewDir, Vector3::UNIT_Z()); 
    425432 
     
    611618        mShadowCam->SetupCameraView(); 
    612619 
     620        dummyMat = mLightProjView; 
     621 
    613622 
    614623        ////////////// 
     
    696705        mLightProjView = lightView * lightProj; 
    697706 
    698         //dummy = mLightProjView; 
     707        dummyMat = mLightProjView; 
    699708 
    700709        DEL_PTR(lightPoly); 
Note: See TracChangeset for help on using the changeset viewer.