- Timestamp:
- 08/31/08 15:27:31 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r2887 r2888 10 10 winHeight=768 11 11 camPosition=483.398f 242.364f 186.078f 12 camDirection=-1 0 0 12 camDirection=0 1 0 13 //camDirection=1 0 0 13 14 useFullScreen=0 14 15 useLODs=1 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp
r2887 r2888 368 368 369 369 // store near plane 370 sNearPlane = Plane3( -mCamera->GetDirection(), mCamera->GetPosition());370 sNearPlane = Plane3(mCamera->GetDirection(), mCamera->GetPosition()); 371 371 } 372 372 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp
r2887 r2888 169 169 170 170 171 172 171 void Camera::ComputePoints(Vector3 &ftl, Vector3 &ftr, Vector3 &fbl, Vector3 &fbr, 173 172 Vector3 &ntl, Vector3 &ntr, Vector3 &nbl, Vector3 &nbr) … … 181 180 const float h_far = w_far / GetAspect(); 182 181 183 const Vector3 view = -GetDirection();182 const Vector3 view = GetDirection(); 184 183 const Vector3 fc = mPosition + view * z_far; 185 184 … … 231 230 void Camera::SetDirection(const Vector3 &dir) 232 231 { 233 Normalize(dir);232 Vector3 ndir = -Normalize(dir); 234 233 235 234 //mPitch = atan2(dir.x, dir.z); 236 235 //mYaw = atan2(dir.y, sqrt((dir.x * dir.x) + (dir.z * dir.z))); 237 236 238 mPitch = -atan2(dir.x, dir.y); 239 mYaw = atan2(dir.z, sqrt((dir.x * dir.x) + (dir.y * dir.y))); 237 //mPitch = atan2(dir.x, dir.y); 238 mPitch = -atan2(ndir.x, ndir.y); 239 mYaw = atan2(ndir.z, sqrt((ndir.x * ndir.x) + (ndir.y * ndir.y))); 240 240 241 241 CalculateFromPitchAndYaw(); … … 257 257 Vector3 Camera::GetDirection() const 258 258 { 259 return Vector3(mViewOrientation.x[0][2], mViewOrientation.x[1][2], mViewOrientation.x[2][2]);259 return -Vector3(mViewOrientation.x[0][2], mViewOrientation.x[1][2], mViewOrientation.x[2][2]); 260 260 } 261 261 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp
r2887 r2888 103 103 bool SceneQuery::CalcIntersection(Vector3 &pt) 104 104 { 105 const int px = ( pt.x - mSceneBox.Min(0)) * (texWidth - 1) / mSceneBox.Size(0);106 const int py = ( pt.y - mSceneBox.Min(1)) * (texHeight - 1) / mSceneBox.Size(1);105 const int px = (mSceneBox.Max(0) - pt.x) * (texWidth - 1) / mSceneBox.Size(0); 106 const int py = (mSceneBox.Max(1) - pt.y) * (texHeight - 1) / mSceneBox.Size(1); 107 107 108 108 float d = mDepth[px + py * texHeight]; … … 137 137 138 138 orthoCam->SetNear(0.0f); 139 orthoCam->SetDirection(Vector3(0, 0, 1));139 orthoCam->SetDirection(Vector3(0, 0, -1)); 140 140 141 141 cout << orthoCam->GetDirection() << endl; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp
r2887 r2888 576 576 #if 1 // matT: debug this!! 577 577 578 bl = -Normalize(nbl - fbl);579 br = -Normalize(nbr - fbr);580 tl = -Normalize(ntl - ftl);581 tr = -Normalize(ntr - ftr);578 bl = Normalize(nbl - fbl); 579 br = Normalize(nbr - fbr); 580 tl = Normalize(ntl - ftl); 581 tr = Normalize(ntr - ftr); 582 582 583 583 #else // just take camera direction -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2887 r2888 330 330 camera = new Camera(winWidth, winHeight, fov); 331 331 camera->SetNear(nearDist); 332 332 camera->SetFar(1000); 333 333 334 cout << "here2 " << Normalize(camDir) << endl; 334 335 335 336 camera->SetDirection(camDir); 337 336 338 cout << "here3 " << camera->GetDirection() << endl; 339 cout << "here3 " << camera->GetRightVector() << endl; 340 cout << "here3 " << camera->GetUpVector() << endl; 341 337 342 camera->SetPosition(camPos); 338 343 … … 829 834 void KeyHorizontalMotion(float shift) 830 835 { 831 Vector3 hvec = camera->GetDirection();836 Vector3 hvec = -camera->GetDirection(); 832 837 hvec.z = 0; 833 838 … … 1375 1380 camera->Pitch(eyeXAngle); 1376 1381 1377 pos -= horView * (yMotionBegin - y) * 0.2f;1382 pos += horView * (yMotionBegin - y) * 0.2f; 1378 1383 1379 1384 camera->SetPosition(pos); … … 1417 1422 rVec = rot * rVec; 1418 1423 1419 pos += rVec * (x - horizontalMotionBegin) * 0.1f;1424 pos -= rVec * (x - horizontalMotionBegin) * 0.1f; 1420 1425 pos[2] += (verticalMotionBegin - y) * 0.1f; 1421 1426 … … 1539 1544 glClear(GL_DEPTH_BUFFER_BIT); 1540 1545 1546 1541 1547 //////////// 1542 1548 //-- visualization of the occlusion culling … … 1544 1550 visualization->Render(); 1545 1551 1552 // coordinates 1546 1553 glColor3f(0.0f, 1.0f, 0.0f); 1547 1554 glBegin(GL_LINES); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2887 r2888 95 95 96 96 //return max(0.0f, 1.0f - total_ao); 97 return saturate(dot(currentViewDir, currentNormal)); 97 //return saturate(dot(currentViewDir, currentNormal)); 98 return saturate(dot(currentViewDir, float3(0, -1, 0))); 98 99 } 99 100
Note: See TracChangeset
for help on using the changeset viewer.