Changeset 2771 for GTP/trunk/App/Demos/Vis/CHC_revisited/chcdemo.cpp
- Timestamp:
- 06/18/08 17:33:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/CHC_revisited/chcdemo.cpp
r2770 r2771 41 41 /// the rendering algorithm 42 42 int renderMode = RenderTraverser::CULL_FRUSTUM; 43 /// the visibility threshold44 int threshold = 0;45 43 // eye near plane distance 46 44 float nearDist = 0.1f; 45 /// the pixel threshold where a node is still considered invisible 46 int threshold; 47 47 48 48 49 const float keyForwardMotion = 1.0f; … … 71 72 bool showBoundingVolumes = false; 72 73 bool visMode = false; 73 74 75 // visualisation view matrix76 Matrix4x4 visView;77 74 78 75 //mouse navigation state … … 154 151 //bvh = bvhLoader.Load("house_test.bvh", sceneEntities); 155 152 153 bvh->SetCamera(camera); 156 154 ResetTraverser(); 157 155 … … 284 282 DEL_PTR(traverser); 285 283 284 bvh->ResetNodeClassifications(); 285 286 286 switch (renderMode) 287 287 { … … 427 427 break; 428 428 case '+': 429 threshold = traverser->GetVisibilityThreshold() +10;429 threshold += 10; 430 430 traverser->SetVisibilityThreshold(threshold); 431 431 break; 432 432 case '-': 433 threshold = traverser->GetVisibilityThreshold() -10;433 threshold -= 10; 434 434 if(threshold < 0) threshold = 0; 435 436 435 traverser->SetVisibilityThreshold(threshold); 437 436 break; … … 776 775 glViewport(winWidth / 2, winHeight / 2, winWidth, winHeight); 777 776 glPushMatrix(); 778 glLoadMatrixf((float *)visView.x);777 //glLoadMatrixf((float *)visView.x); 779 778 780 779 glClear(GL_DEPTH_BUFFER_BIT); … … 859 858 860 859 static long renderTime = traverser->GetStats().mRenderTime; 861 const float expFactor = 0. 5f;860 const float expFactor = 0.95f; 862 861 renderTime = traverser->GetStats().mRenderTime * expFactor + (1.0f - expFactor) * renderTime; 863 862 864 863 accumulatedTime += renderTime; 865 864 866 if (accumulatedTime > 200) // update every fraction of a second865 if (accumulatedTime > 100) // update every fraction of a second 867 866 { 868 867 accumulatedTime = 0; … … 877 876 } 878 877 879 sprintf_s(msg2, "threshold: %4d%s", 880 traverser->GetVisibilityThreshold(), optstr[useOptimization]); 878 sprintf_s(msg2, "threshold: %4d%s", threshold, optstr[useOptimization]); 881 879 882 880 string str;
Note: See TracChangeset
for help on using the changeset viewer.