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

Legend:

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

    r2787 r2788  
    1414namespace CHCDemoEngine 
    1515{ 
     16 
     17        GLUquadric *mSphere; 
    1618 
    1719/******************************************************/ 
     
    3032mFrameId(0) 
    3133{ 
     34        mSphere = (GLUquadric *)gluNewQuadric(); 
    3235} 
    3336 
     
    5659        tStack.push(mBvh->GetRoot()); 
    5760 
     61        glDisable(GL_LIGHTING); 
     62         
     63        RenderViewPoint(); 
     64        RenderFrustum(); 
     65        RenderBox(mBvh->GetBox()); 
     66 
     67        glEnable(GL_LIGHTING); 
     68 
    5869        glEnableClientState(GL_VERTEX_ARRAY); 
    5970        glEnableClientState(GL_NORMAL_ARRAY); 
    60  
    61         RenderFrustum(); 
    6271 
    6372        while (!tStack.empty()) 
     
    146155 
    147156        glEnable(GL_CULL_FACE); 
    148  
    149157        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 
    150158} 
     
    153161void Visualization::RenderFrustum() 
    154162{ 
     163        glColor3f(1.0f, 0.0f, 0.0f); 
     164 
    155165        Vector3 ftl, ftr, fbl, fbr, ntl, ntr, nbl, nbr; 
    156166        mCamera->ComputePoints(ftl, ftr, fbl, fbr, ntl, ntr, nbl, nbr); 
     
    202212 
    203213 
    204 } 
     214 
     215void Visualization::RenderViewPoint() 
     216{ 
     217        glPushMatrix(); 
     218        Vector3 pos = mCamera->GetPosition(); 
     219        pos.z += 100; 
     220        glTranslatef(pos.x, pos.y, pos.z); 
     221         
     222        glScalef(5.0f, 5.0f, 5.0f); 
     223        glPushAttrib(GL_CURRENT_BIT); 
     224 
     225        glColor3f(1.0f, 0.0f, 0.0f); 
     226         
     227        gluSphere((::GLUquadric *)mSphere, 
     228                2e-3f * Magnitude(mBvh->GetBox().Size()), 6, 6); 
     229 
     230        glPopAttrib(); 
     231        glPopMatrix(); 
     232} 
     233 
     234} 
Note: See TracChangeset for help on using the changeset viewer.