Changeset 2864


Ignore:
Timestamp:
08/25/08 08:34:10 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
1 added
1 deleted
6 edited

Legend:

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

    r2861 r2864  
    784784                        > 
    785785                        <File 
     786                                RelativePath=".\src\shaders\antialiasing.cg" 
     787                                > 
     788                        </File> 
     789                        <File 
    786790                                RelativePath=".\src\shaders\deferred.cg" 
    787791                                > 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r2861 r2864  
    1010winHeight=768 
    1111camPosition=483.398f 242.364f 186.078f 
    12 camDirection=1 0 0 
     12camDirection=-1 -1 0 
    1313useFullScreen=0 
    1414#modelPath=data/city/model/ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp

    r2850 r2864  
    8282void CHCPlusPlusTraverser::Traverse() 
    8383{ 
     84        int waitedForQueries = 0; 
     85        int returnedQueries = 0; 
     86 
    8487        //-- PART 1: process finished occlusion queries 
    8588        while (!mDistanceQueue.empty() || !mQueryQueue.empty()) 
     
    101104                        } 
    102105                         
     106                        if (!resultAvailable) 
     107                                ++ waitedForQueries; 
     108                        ++ returnedQueries; 
     109 
    103110                        OcclusionQuery *query = mQueryQueue.front(); 
    104111                        mQueryQueue.pop(); 
     
    211218                HandleQueryResult(query); 
    212219        } 
     220 
     221        //cout << "returned queries: " << returnedQueries << " waited for queries: " << waitedForQueries << " (=" << 100.0f * waitedForQueries / returnedQueries << "%)" << endl; 
    213222} 
    214223 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp

    r2860 r2864  
    221221 
    222222 
    223 void Camera::SetDirection(const Vector3 &direction) 
    224 { 
    225         Vector3 h1 = direction; h1.z = 0;  
    226          
    227         if (SqrMagnitude(h1) > 0) 
    228         { 
    229                 h1.Normalize(); 
    230                 mPitch = acos(DotProd(h1, Vector3(0, 1, 0))); 
    231         } 
    232  
    233         Vector3 h2 = direction;  
    234          
    235         if (SqrMagnitude(h2) > 0) 
    236         { 
    237                 h2.Normalize(); 
    238                 mYaw = -acos(DotProd(h2, h1)); 
    239         } 
     223void Camera::SetDirection(const Vector3 &dir) 
     224{ 
     225        Normalize(dir); 
     226 
     227        mPitch = atan2(dir.x, dir.z); 
     228        mYaw = atan2(dir.y, sqrt((dir.x * dir.x) + (dir.z * dir.z))); 
    240229 
    241230        CalculateFromPitchAndYaw(); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.cpp

    r2806 r2864  
    168168        glBegin(GL_LINE_LOOP); 
    169169        glVertex3d(fbl.x, fbl.y, fbl.z); 
    170         glVertex3d(fbr.x, fbr.y, fbr.z); 
    171         glVertex3d(ftr.x, ftr.y, ftr.z); 
    172         glVertex3d(ftl.x, ftl.y, ftl.z); 
    173         glEnd(); 
    174  
    175         glBegin(GL_LINE_LOOP); 
    176         glVertex3d(nbl.x, nbl.y, nbl.z); 
    177         glVertex3d(nbr.x, nbr.y, nbr.z); 
    178         glVertex3d(ntr.x, ntr.y, ntr.z); 
    179         glVertex3d(ntl.x, ntl.y, ntl.z); 
    180         glEnd(); 
    181  
    182         glBegin(GL_LINE_LOOP); 
    183         glVertex3d(fbl.x, fbl.y, fbl.z); 
    184170        glVertex3d(ftl.x, ftl.y, ftl.z); 
    185171        glVertex3d(ntl.x, ntl.y, ntl.z); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2861 r2864  
    746746void SetupEyeView() 
    747747{ 
    748         Matrix4x4 matViewing, matProjection; 
    749  
    750748        // store matrix of last frame 
    751749        oldViewProjMatrix = matProjectionView; 
     
    758756        glMatrixMode(GL_MODELVIEW); 
    759757        glLoadIdentity(); 
     758 
     759        // set up the camera view 
    760760        camera->SetupCameraView(); 
    761761 
     762        // set lights 
    762763        GLfloat position[] = {0.8f, -1.0f, 0.7f, 0.0f}; 
    763764        glLightfv(GL_LIGHT0, GL_POSITION, position); 
     
    767768 
    768769         
     770        ///////////////// 
     771 
     772        Matrix4x4 matViewing, matProjection; 
     773 
    769774        camera->GetModelViewMatrix(matViewing); 
    770775        camera->GetProjectionMatrix(matProjection); 
    771776 
     777        // store matrix for later use 
    772778        matProjectionView = matViewing * matProjection; 
    773779         
Note: See TracChangeset for help on using the changeset viewer.