Changeset 502 for trunk/VUT/GtpVisibilityPreprocessor/src
- Timestamp:
- 01/05/06 16:06:31 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp
r497 r502 26 26 // timerId = startTimer(10); 27 27 mFrame = 0; 28 mWireFrame = false; 28 29 } 29 30 … … 81 82 82 83 for (i=0; i < mesh->mFaces.size(); i++) { 83 glBegin(GL_POLYGON); 84 if (mWireFrame) 85 glBegin(GL_POLYGON); 86 else 87 glBegin(GL_LINE_LOOP); 88 84 89 Face *face = mesh->mFaces[i]; 85 90 for (int j = 0; j < face->mVertexIndices.size(); j++) { … … 309 314 // now render im1 310 315 if (viewcell) { 316 if (mTopView) { 317 mWireFrame = true; 318 RenderMeshInstance(viewcell); 319 mWireFrame = false; 320 } 321 311 322 // init ortographic projection 312 323 glMatrixMode(GL_PROJECTION); … … 388 399 389 400 makeCurrent(); 390 391 401 SetupProjection(GetWidth(), GetHeight()); 392 402 … … 481 491 mFrame++; 482 492 } 493 494 495 void 496 GlRendererWidget::SetupCamera() 497 { 498 if (!mTopView) 499 GlRenderer::SetupCamera(); 500 else { 501 float dist = Magnitude(mSceneGraph->GetBox().Diagonal())*0.05; 502 Vector3 pos = mViewPoint - dist*Vector3(mViewDirection.x, 503 1, 504 mViewDirection.y); 505 506 Vector3 target = mViewPoint + dist*mViewDirection; 507 Vector3 up(0,1,0); 508 509 glLoadIdentity(); 510 gluLookAt(mViewPoint.x, mViewPoint.y, mViewPoint.z, 511 target.x, target.y, target.z, 512 up.x, up.y, up.z); 513 } 514 515 } -
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.h
r500 r502 24 24 int frames; 25 25 int errorFreeFrames; 26 26 27 27 PvsRenderStatistics() { Reset(); } 28 28 … … 61 61 62 62 int mFrame; 63 63 bool mWireFrame; 64 64 65 QWaitCondition mRenderingFinished; 65 66 … … 76 77 void RenderMesh(Mesh *m); 77 78 void SetupMaterial(Material *m); 78 v oid SetupCamera();79 virtual void SetupCamera(); 79 80 void RandomViewPoint(); 80 81 … … 119 120 makeCurrent(); 120 121 InitGL(); 121 122 doneCurrent(); 123 122 124 } 123 125 … … 142 144 public: 143 145 146 // point of the last mouse click used for movement in the scene 147 Vector3 mousePoint; 148 149 bool mTopView; 150 144 151 GlRendererWidget(SceneGraph *sceneGraph, 145 152 ViewCellsManager *viewcells, … … 147 154 ): 148 155 GlRenderer(sceneGraph, viewcells), QGLWidget(parent, shareWidget, f) 149 {} 156 { 157 mTopView = false; 158 } 150 159 151 Vector3 mousePoint;152 160 virtual void SetupCamera(); 161 153 162 void initializeGL() { 154 163 InitGL(); -
trunk/VUT/GtpVisibilityPreprocessor/src/Makefile
r499 r502 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.0) on: st 4. I 19:53:2620063 # Generated by qmake (2.00a) (Qt 4.1.0) on: ?t 5. I 09:42:49 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app -
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp
r501 r502 610 610 "#RssSamples\n" <<rssSamples<<endl; 611 611 612 ComputeRenderError(); 613 614 mVssRays.PrintStatistics(mStats); 615 mViewCellsManager->PrintPvsStatistics(mStats); 616 617 VssRayContainer selectedRays; 618 int desired = Max( 619 mViewCellsManager->GetPostProcessSamples(), 620 mViewCellsManager->GetVisualizationSamples()); 621 622 mVssRays.SelectRays(desired, selectedRays); 623 624 //-- post process view cells 625 mViewCellsManager->PostProcess(mObjects, selectedRays); 626 627 //-- several visualizations and statistics 628 Debug << "view cells after post processing: " << endl; 629 mViewCellsManager->PrintStatistics(Debug); 630 631 if (1) 632 mViewCellsManager->Visualize(mObjects, selectedRays); 633 } 612 613 mVssRays.PrintStatistics(mStats); 614 mViewCellsManager->PrintPvsStatistics(mStats); 615 616 VssRayContainer selectedRays; 617 int desired = Max( 618 mViewCellsManager->GetPostProcessSamples(), 619 mViewCellsManager->GetVisualizationSamples()); 620 621 mVssRays.SelectRays(desired, selectedRays); 622 623 //-- post process view cells 624 mViewCellsManager->PostProcess(mObjects, selectedRays); 625 626 //-- several visualizations and statistics 627 Debug << "view cells after post processing: " << endl; 628 mViewCellsManager->PrintStatistics(Debug); 629 630 if (1) 631 mViewCellsManager->Visualize(mObjects, selectedRays); 632 633 ComputeRenderError(); 634 635 } 634 636 635 637 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r495 r502 2676 2676 BspTree::GetViewCell(const Vector3 &point) 2677 2677 { 2678 if (mRoot == NULL) 2679 return NULL; 2680 2681 2678 2682 stack<BspNode *> nodeStack; 2679 2683 nodeStack.push(mRoot); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r501 r502 1035 1035 exporter->ExportPolygons(cell); 1036 1036 } 1037 } 1038 1039 ViewCell * 1040 BspViewCellsManager::GetViewCell(const Vector3 &point) 1041 { 1042 if (!mBspTree) 1043 return NULL; 1044 return mBspTree->GetViewCell(point); 1037 1045 } 1038 1046 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h
r492 r502 344 344 345 345 /** Get a viewcell containing the specified point */ 346 ViewCell *GetViewCell(const Vector3 &point) { return NULL; }346 ViewCell *GetViewCell(const Vector3 &point); 347 347 348 348 protected: -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r497 r502 23 23 useGlRenderer true 24 24 # type sampling 25 type vss26 #type rss25 # type vss 26 type rss 27 27 } 28 28 … … 169 169 #type kdTree 170 170 #type vspKdTree 171 172 # 171 type bspTree 172 #type vspBspTree 173 173 174 174 #type sceneDependent
Note: See TracChangeset
for help on using the changeset viewer.