- Timestamp:
- 06/20/08 06:15:17 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.cpp
r2787 r2788 14 14 namespace CHCDemoEngine 15 15 { 16 17 GLUquadric *mSphere; 16 18 17 19 /******************************************************/ … … 30 32 mFrameId(0) 31 33 { 34 mSphere = (GLUquadric *)gluNewQuadric(); 32 35 } 33 36 … … 56 59 tStack.push(mBvh->GetRoot()); 57 60 61 glDisable(GL_LIGHTING); 62 63 RenderViewPoint(); 64 RenderFrustum(); 65 RenderBox(mBvh->GetBox()); 66 67 glEnable(GL_LIGHTING); 68 58 69 glEnableClientState(GL_VERTEX_ARRAY); 59 70 glEnableClientState(GL_NORMAL_ARRAY); 60 61 RenderFrustum();62 71 63 72 while (!tStack.empty()) … … 146 155 147 156 glEnable(GL_CULL_FACE); 148 149 157 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 150 158 } … … 153 161 void Visualization::RenderFrustum() 154 162 { 163 glColor3f(1.0f, 0.0f, 0.0f); 164 155 165 Vector3 ftl, ftr, fbl, fbr, ntl, ntr, nbl, nbr; 156 166 mCamera->ComputePoints(ftl, ftr, fbl, fbr, ntl, ntr, nbl, nbr); … … 202 212 203 213 204 } 214 215 void 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.