Ignore:
Timestamp:
06/29/08 02:31:58 (16 years ago)
Author:
mattausch
Message:

improved visualization

File:
1 edited

Legend:

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

    r2803 r2806  
    163163        camera = new Camera(winWidth, winHeight, fov); 
    164164        camera->SetNear(nearDist); 
    165  
     165         
    166166        visCamera = new Camera(winWidth, winHeight, fov); 
     167 
    167168        visCamera->SetNear(0.0f); 
    168169        visCamera->Yaw(.5 * M_PI); 
     
    233234        } 
    234235 
     236        camera->SetFar(0.7f * Magnitude(bvh->GetBox().Diagonal())); 
     237 
    235238        bvh->SetCamera(camera); 
    236239 
    237240        ResetTraverser(); 
    238241 
    239         //camera->SetDirection(Vector3(0.961829f, 0.273652f, 0.0f)); 
    240242        camera->Pitch(-M_PI * 0.5); 
    241243        camera->SetPosition(Vector3(483.398f, 242.364f, 186.078f)); 
     
    992994        glColor4f(0.0,0.0,0.0,0.5);  
    993995 
    994         glRecti(winWidth, 0, winWidth - winWidth / 4, winHeight / 3); 
     996        glRecti(winWidth, 0, winWidth - winWidth / 3, winHeight / 3); 
    995997        glDisable(GL_BLEND); 
    996998        End2D(); 
     
    10021004        const float yoffs = box.Size().y * 0.5f; 
    10031005 
    1004         Vector3 vizpos = Vector3(box.Center().x, box.Center().y, box.Max().z); 
     1006        Vector3 pos = camera->GetPosition(); 
     1007 
     1008        Vector3 vizpos = Vector3(box.Min().x, box.Min().y + 700, box.Min().z + box.Size().z * 50); 
     1009         
    10051010        visCamera->SetPosition(vizpos); 
    10061011         
    1007         glViewport(winWidth - winWidth / 4, winHeight - winHeight / 3, winWidth / 4, winHeight / 3); 
     1012        glViewport(winWidth - winWidth / 3, winHeight - winHeight / 3, winWidth / 3, winHeight / 3); 
    10081013 
    10091014        glMatrixMode(GL_PROJECTION); 
    10101015        glLoadIdentity(); 
    10111016         
    1012         glOrtho(-xoffs, xoffs, -yoffs, yoffs, 0.0f, box.Size().z);  
     1017        glOrtho(-xoffs, xoffs, -xoffs, xoffs, 0.0f, box.Size().z * 100.0f);  
    10131018 
    10141019        glMatrixMode(GL_MODELVIEW); 
    10151020 
    10161021        visCamera->SetupCameraView(); 
    1017          
     1022 
     1023        Matrix4x4 rotZ = RotationZMatrix(-camera->GetPitch()); 
     1024        glMultMatrixf((float *)rotZ.x); 
     1025 
     1026        glTranslatef(-pos.x, -pos.y, -pos.z); 
     1027 
     1028 
    10181029        GLfloat position[] = {0.8f, 1.0f, 1.5f, 0.0f}; 
    10191030        glLightfv(GL_LIGHT0, GL_POSITION, position); 
     
    10241035        glClear(GL_DEPTH_BUFFER_BIT); 
    10251036 
     1037 
    10261038        //////////// 
    10271039        //-- visualization of the occlusion culling 
     
    10291041        visualization->Render(); 
    10301042         
     1043        // reset vp 
    10311044        glViewport(0, 0, winWidth, winHeight); 
    10321045} 
Note: See TracChangeset for help on using the changeset viewer.