Ignore:
Timestamp:
06/18/08 17:33:16 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2770 r2771  
    4141/// the rendering algorithm 
    4242int renderMode = RenderTraverser::CULL_FRUSTUM; 
    43 /// the visibility threshold 
    44 int threshold = 0; 
    4543// eye near plane distance 
    4644float nearDist = 0.1f;  
     45/// the pixel threshold where a node is still considered invisible 
     46int threshold; 
     47 
    4748 
    4849const float keyForwardMotion = 1.0f; 
     
    7172bool showBoundingVolumes = false; 
    7273bool visMode = false; 
    73  
    74  
    75 // visualisation view matrix 
    76 Matrix4x4 visView;  
    7774 
    7875//mouse navigation state 
     
    154151        //bvh = bvhLoader.Load("house_test.bvh", sceneEntities); 
    155152 
     153        bvh->SetCamera(camera); 
    156154        ResetTraverser(); 
    157155 
     
    284282        DEL_PTR(traverser); 
    285283 
     284        bvh->ResetNodeClassifications(); 
     285 
    286286        switch (renderMode) 
    287287        { 
     
    427427                break; 
    428428        case '+': 
    429                 threshold = traverser->GetVisibilityThreshold() + 10; 
     429                threshold += 10; 
    430430                traverser->SetVisibilityThreshold(threshold); 
    431431                break; 
    432432        case '-': 
    433                 threshold = traverser->GetVisibilityThreshold() - 10; 
     433                threshold -= 10; 
    434434                if(threshold < 0) threshold = 0; 
    435  
    436435                traverser->SetVisibilityThreshold(threshold);            
    437436                break; 
     
    776775        glViewport(winWidth / 2, winHeight / 2, winWidth, winHeight); 
    777776        glPushMatrix(); 
    778         glLoadMatrixf((float *)visView.x); 
     777        //glLoadMatrixf((float *)visView.x); 
    779778         
    780779        glClear(GL_DEPTH_BUFFER_BIT); 
     
    859858         
    860859        static long renderTime = traverser->GetStats().mRenderTime; 
    861         const float expFactor = 0.5f; 
     860        const float expFactor = 0.95f; 
    862861        renderTime = traverser->GetStats().mRenderTime * expFactor + (1.0f - expFactor) * renderTime; 
    863862 
    864863        accumulatedTime += renderTime; 
    865864 
    866         if (accumulatedTime > 200) // update every fraction of a second 
     865        if (accumulatedTime > 100) // update every fraction of a second 
    867866        {        
    868867                accumulatedTime = 0; 
     
    877876        } 
    878877 
    879         sprintf_s(msg2, "threshold: %4d%s",  
    880                 traverser->GetVisibilityThreshold(), optstr[useOptimization]); 
     878        sprintf_s(msg2, "threshold: %4d%s", threshold, optstr[useOptimization]); 
    881879 
    882880        string str; 
Note: See TracChangeset for help on using the changeset viewer.