Changeset 2778 for GTP/trunk/App/Demos/Vis/CHC_revisited/SceneQuery.cpp
- Timestamp:
- 06/19/08 18:07:09 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/CHC_revisited/SceneQuery.cpp
r2776 r2778 3 3 #include "Vector3.h" 4 4 #include "Camera.h" 5 #include "SceneQuery.h" 6 #include "RenderTraverser.h" 5 7 6 8 … … 20 22 21 23 22 SceneQuery::SceneQuery(const AxisAlignedBox3 &sceneBox ):24 SceneQuery::SceneQuery(const AxisAlignedBox3 &sceneBox, RenderTraverser *renderer): 23 25 mSceneBox(sceneBox) 24 26 { 25 Prepare( );27 Prepare(renderer); 26 28 } 27 29 … … 45 47 } 46 48 47 void SceneQuery::Prepare() 49 50 void SceneQuery::Prepare(RenderTraverser *renderer) 48 51 { 49 52 cout << "Preparing scene queries" << endl; … … 56 59 pos.z = mSceneBox.Center(2); 57 60 58 Camera *orthoCam = new Camera();59 //orthoCam->SetOrtho(true);60 61 // contain match scene bounding box;62 63 61 // for ortho cam this is the width 64 62 const Vector3 len = mSceneBox.Size(); 65 /* 66 orthoCam->SetFov(len.x);67 orthoCam->Set Aspect(len.x / len.y);63 64 Camera *orthoCam = new Camera(len.x, len.y); 65 orthoCam->SetOrtho(true); 68 66 69 67 orthoCam->SetNear(0.0f); … … 72 70 orthoCam->SetPosition(pos); 73 71 74 OUT1("fov: " << orthoCam->GetFov());75 OUT1("near: " << orthoCam->GetNear());76 OUT1("far: " << orthoCam->GetFar());77 OUT1("aspect: " << orthoCam->GetAspect());72 cout << "fov: " << orthoCam->GetFov() << endl; 73 cout << "near: " << orthoCam->GetNear() << endl; 74 cout << "far: " << orthoCam->GetFar() << endl; 75 cout << "aspect: " << orthoCam->GetAspect() << endl; 78 76 79 OUT1("pos: " << orthoCam->GetPosition());80 OUT1("view: " << orthoCam->GetViewDirection());81 OUT1("up: " << orthoCam->GetViewUpVector());77 cout << "pos: " << orthoCam->GetPosition() << endl; 78 cout << "view: " << orthoCam->GetDirection() << endl; 79 cout << "up: " << orthoCam->GetUpVector() << endl; 82 80 83 const float pitch = 0;84 const float yaw = YA_PI * 0.5f;81 //orthoCam->SetDirection(Vector3(0, 1, 0)); 82 orthoCam->Yaw(M_PI * 0.5f); 85 83 86 OffscreenRenderArea *of = new OffscreenRenderArea();84 renderer->SetCamera(orthoCam); 87 85 88 of->Init(viewport[2], viewport[3]); 89 of->SetRenderAction(new GLRenderAction); 90 91 of->SetCamera(orthoCam); 92 of->SetSceneRoot(mSceneRoot); 93 94 of->Render(); 86 //OffscreenRenderArea *of = new OffscreenRenderArea(); 87 //of->Init(viewport[2], viewport[3]); 95 88 96 sDepth = of->GetDepthFloat(); 97 */ 89 renderer->RenderScene(); 90 //sDepth = of->GetDepthFloat(); 91 92 delete orthoCam; 98 93 } 99 94
Note: See TracChangeset
for help on using the changeset viewer.