Changeset 2888 for GTP


Ignore:
Timestamp:
08/31/08 15:27:31 (16 years ago)
Author:
mattausch
Message:

corrected views

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r2887 r2888  
    1010winHeight=768 
    1111camPosition=483.398f 242.364f 186.078f 
    12 camDirection=-1 0 0 
     12camDirection=0 1 0 
     13//camDirection=1 0 0 
    1314useFullScreen=0 
    1415useLODs=1 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp

    r2887 r2888  
    368368 
    369369        // store near plane 
    370         sNearPlane = Plane3(-mCamera->GetDirection(), mCamera->GetPosition()); 
     370        sNearPlane = Plane3(mCamera->GetDirection(), mCamera->GetPosition()); 
    371371} 
    372372 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp

    r2887 r2888  
    169169 
    170170 
    171  
    172171void Camera::ComputePoints(Vector3 &ftl, Vector3 &ftr, Vector3 &fbl, Vector3 &fbr, 
    173172                                                   Vector3 &ntl, Vector3 &ntr, Vector3 &nbl, Vector3 &nbr) 
     
    181180        const float h_far = w_far / GetAspect(); 
    182181 
    183         const Vector3 view = -GetDirection(); 
     182        const Vector3 view = GetDirection(); 
    184183        const Vector3 fc = mPosition + view * z_far;  
    185184         
     
    231230void Camera::SetDirection(const Vector3 &dir) 
    232231{ 
    233         Normalize(dir); 
     232        Vector3 ndir = -Normalize(dir); 
    234233 
    235234        //mPitch = atan2(dir.x, dir.z); 
    236235        //mYaw = atan2(dir.y, sqrt((dir.x * dir.x) + (dir.z * dir.z))); 
    237236 
    238         mPitch = -atan2(dir.x, dir.y); 
    239         mYaw = atan2(dir.z, sqrt((dir.x * dir.x) + (dir.y * dir.y))); 
     237        //mPitch = atan2(dir.x, dir.y); 
     238        mPitch = -atan2(ndir.x, ndir.y); 
     239        mYaw = atan2(ndir.z, sqrt((ndir.x * ndir.x) + (ndir.y * ndir.y))); 
    240240 
    241241        CalculateFromPitchAndYaw(); 
     
    257257Vector3 Camera::GetDirection() const 
    258258{  
    259         return Vector3(mViewOrientation.x[0][2], mViewOrientation.x[1][2], mViewOrientation.x[2][2]); 
     259        return -Vector3(mViewOrientation.x[0][2], mViewOrientation.x[1][2], mViewOrientation.x[2][2]); 
    260260} 
    261261 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp

    r2887 r2888  
    103103bool SceneQuery::CalcIntersection(Vector3 &pt) 
    104104{ 
    105         const int px = (pt.x - mSceneBox.Min(0)) * (texWidth - 1) / mSceneBox.Size(0); 
    106         const int py = (pt.y - mSceneBox.Min(1)) * (texHeight - 1) / mSceneBox.Size(1); 
     105        const int px = (mSceneBox.Max(0) - pt.x) * (texWidth - 1) / mSceneBox.Size(0); 
     106        const int py = (mSceneBox.Max(1) - pt.y) * (texHeight - 1) / mSceneBox.Size(1); 
    107107 
    108108        float d = mDepth[px + py * texHeight]; 
     
    137137 
    138138        orthoCam->SetNear(0.0f); 
    139         orthoCam->SetDirection(Vector3(0, 0, 1)); 
     139        orthoCam->SetDirection(Vector3(0, 0, -1)); 
    140140 
    141141        cout << orthoCam->GetDirection() << endl; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp

    r2887 r2888  
    576576#if 1 // matT: debug this!! 
    577577         
    578         bl = -Normalize(nbl - fbl); 
    579         br = -Normalize(nbr - fbr); 
    580         tl = -Normalize(ntl - ftl); 
    581         tr = -Normalize(ntr - ftr); 
     578        bl = Normalize(nbl - fbl); 
     579        br = Normalize(nbr - fbr); 
     580        tl = Normalize(ntl - ftl); 
     581        tr = Normalize(ntr - ftr); 
    582582 
    583583#else // just take camera direction 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2887 r2888  
    330330        camera = new Camera(winWidth, winHeight, fov); 
    331331        camera->SetNear(nearDist); 
    332          
     332        camera->SetFar(1000); 
     333 
    333334        cout << "here2 " << Normalize(camDir) << endl; 
    334335 
    335336        camera->SetDirection(camDir); 
     337 
    336338        cout << "here3 " << camera->GetDirection() << endl; 
     339        cout << "here3 " << camera->GetRightVector() << endl; 
     340        cout << "here3 " << camera->GetUpVector() << endl; 
     341 
    337342        camera->SetPosition(camPos); 
    338343 
     
    829834void KeyHorizontalMotion(float shift) 
    830835{ 
    831         Vector3 hvec = camera->GetDirection(); 
     836        Vector3 hvec = -camera->GetDirection(); 
    832837        hvec.z = 0; 
    833838 
     
    13751380        camera->Pitch(eyeXAngle); 
    13761381 
    1377         pos -= horView * (yMotionBegin - y) * 0.2f; 
     1382        pos += horView * (yMotionBegin - y) * 0.2f; 
    13781383         
    13791384        camera->SetPosition(pos); 
     
    14171422        rVec = rot * rVec; 
    14181423         
    1419         pos += rVec * (x - horizontalMotionBegin) * 0.1f; 
     1424        pos -= rVec * (x - horizontalMotionBegin) * 0.1f; 
    14201425        pos[2] += (verticalMotionBegin - y) * 0.1f; 
    14211426 
     
    15391544        glClear(GL_DEPTH_BUFFER_BIT); 
    15401545 
     1546 
    15411547        //////////// 
    15421548        //-- visualization of the occlusion culling 
     
    15441550        visualization->Render(); 
    15451551 
     1552        // coordinates 
    15461553        glColor3f(0.0f, 1.0f, 0.0f); 
    15471554        glBegin(GL_LINES); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2887 r2888  
    9595 
    9696        //return max(0.0f, 1.0f - total_ao); 
    97         return saturate(dot(currentViewDir, currentNormal)); 
     97        //return saturate(dot(currentViewDir, currentNormal)); 
     98        return saturate(dot(currentViewDir, float3(0, -1, 0))); 
    9899} 
    99100 
Note: See TracChangeset for help on using the changeset viewer.