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/Visualization.cpp

    r2796 r2806  
    6464 
    6565/******************************************************/ 
    66 /*           Vizualization implementation           */ 
     66/*           Vizualization implementation             */ 
    6767/******************************************************/ 
    6868 
     
    7878mFrameId(0) 
    7979{ 
    80         mSphere = (GLUquadric *)gluNewQuadric(); 
    8180} 
    8281 
     
    8483Visualization::~Visualization()  
    8584{ 
    86         //DEL_PTR(mSphere); 
    8785} 
    8886 
     
    110108        stack<BvhNode *> tStack; 
    111109        tStack.push(mBvh->GetRoot()); 
    112  
    113         glDisable(GL_LIGHTING); 
    114          
    115         RenderViewPoint(); 
    116         RenderFrustum(); 
    117         RenderBoxForViz(mBvh->GetBox()); 
    118  
    119         glEnable(GL_LIGHTING); 
    120110 
    121111        glEnableClientState(GL_VERTEX_ARRAY); 
     
    147137                                }                
    148138                        } 
    149                         //leaves.push_back(static_cast<BvhLeaf *>(node)); 
    150139                } 
    151140        } 
    152141 
    153         mRenderState->Reset(); 
    154  
    155142        glDisableClientState(GL_VERTEX_ARRAY); 
    156143        glDisableClientState(GL_NORMAL_ARRAY); 
    157 } 
    158  
    159  
    160 void Visualization::RenderViewPoint() 
    161 { 
    162         glPushMatrix(); 
    163         Vector3 pos = mCamera->GetPosition(); 
    164         pos.z += 100; 
    165         glTranslatef(pos.x, pos.y, pos.z); 
     144 
     145 
     146        mRenderState->Reset(); 
     147 
     148        glPushAttrib(GL_CURRENT_BIT); 
     149        glDisable(GL_LIGHTING); 
     150        glDisable(GL_DEPTH_TEST); 
     151 
     152        RenderFrustum(); 
     153        //RenderBoxForViz(mBvh->GetBox()); 
    166154         
    167         glScalef(5.0f, 5.0f, 5.0f); 
    168         glPushAttrib(GL_CURRENT_BIT); 
    169  
    170         glColor3f(1.0f, 0.0f, 0.0f); 
    171          
    172         gluSphere((::GLUquadric *)mSphere, 
    173                 2e-3f * Magnitude(mBvh->GetBox().Size()), 6, 6); 
    174  
    175155        glPopAttrib(); 
    176         glPopMatrix(); 
    177156} 
    178157 
Note: See TracChangeset for help on using the changeset viewer.