- Timestamp:
- 08/25/08 08:34:10 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 1 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj
r2861 r2864 784 784 > 785 785 <File 786 RelativePath=".\src\shaders\antialiasing.cg" 787 > 788 </File> 789 <File 786 790 RelativePath=".\src\shaders\deferred.cg" 787 791 > -
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r2861 r2864 10 10 winHeight=768 11 11 camPosition=483.398f 242.364f 186.078f 12 camDirection= 1 0012 camDirection=-1 -1 0 13 13 useFullScreen=0 14 14 #modelPath=data/city/model/ -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp
r2850 r2864 82 82 void CHCPlusPlusTraverser::Traverse() 83 83 { 84 int waitedForQueries = 0; 85 int returnedQueries = 0; 86 84 87 //-- PART 1: process finished occlusion queries 85 88 while (!mDistanceQueue.empty() || !mQueryQueue.empty()) … … 101 104 } 102 105 106 if (!resultAvailable) 107 ++ waitedForQueries; 108 ++ returnedQueries; 109 103 110 OcclusionQuery *query = mQueryQueue.front(); 104 111 mQueryQueue.pop(); … … 211 218 HandleQueryResult(query); 212 219 } 220 221 //cout << "returned queries: " << returnedQueries << " waited for queries: " << waitedForQueries << " (=" << 100.0f * waitedForQueries / returnedQueries << "%)" << endl; 213 222 } 214 223 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp
r2860 r2864 221 221 222 222 223 void Camera::SetDirection(const Vector3 &direction) 224 { 225 Vector3 h1 = direction; h1.z = 0; 226 227 if (SqrMagnitude(h1) > 0) 228 { 229 h1.Normalize(); 230 mPitch = acos(DotProd(h1, Vector3(0, 1, 0))); 231 } 232 233 Vector3 h2 = direction; 234 235 if (SqrMagnitude(h2) > 0) 236 { 237 h2.Normalize(); 238 mYaw = -acos(DotProd(h2, h1)); 239 } 223 void Camera::SetDirection(const Vector3 &dir) 224 { 225 Normalize(dir); 226 227 mPitch = atan2(dir.x, dir.z); 228 mYaw = atan2(dir.y, sqrt((dir.x * dir.x) + (dir.z * dir.z))); 240 229 241 230 CalculateFromPitchAndYaw(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Visualization.cpp
r2806 r2864 168 168 glBegin(GL_LINE_LOOP); 169 169 glVertex3d(fbl.x, fbl.y, fbl.z); 170 glVertex3d(fbr.x, fbr.y, fbr.z);171 glVertex3d(ftr.x, ftr.y, ftr.z);172 glVertex3d(ftl.x, ftl.y, ftl.z);173 glEnd();174 175 glBegin(GL_LINE_LOOP);176 glVertex3d(nbl.x, nbl.y, nbl.z);177 glVertex3d(nbr.x, nbr.y, nbr.z);178 glVertex3d(ntr.x, ntr.y, ntr.z);179 glVertex3d(ntl.x, ntl.y, ntl.z);180 glEnd();181 182 glBegin(GL_LINE_LOOP);183 glVertex3d(fbl.x, fbl.y, fbl.z);184 170 glVertex3d(ftl.x, ftl.y, ftl.z); 185 171 glVertex3d(ntl.x, ntl.y, ntl.z); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2861 r2864 746 746 void SetupEyeView() 747 747 { 748 Matrix4x4 matViewing, matProjection;749 750 748 // store matrix of last frame 751 749 oldViewProjMatrix = matProjectionView; … … 758 756 glMatrixMode(GL_MODELVIEW); 759 757 glLoadIdentity(); 758 759 // set up the camera view 760 760 camera->SetupCameraView(); 761 761 762 // set lights 762 763 GLfloat position[] = {0.8f, -1.0f, 0.7f, 0.0f}; 763 764 glLightfv(GL_LIGHT0, GL_POSITION, position); … … 767 768 768 769 770 ///////////////// 771 772 Matrix4x4 matViewing, matProjection; 773 769 774 camera->GetModelViewMatrix(matViewing); 770 775 camera->GetProjectionMatrix(matProjection); 771 776 777 // store matrix for later use 772 778 matProjectionView = matViewing * matProjection; 773 779
Note: See TracChangeset
for help on using the changeset viewer.