Changeset 2571 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 12/18/07 17:40:35 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2570 r2571 303 303 glEnable(GL_LIGHT1); 304 304 305 306 305 // set position of the light 307 306 GLfloat infinite_light[] = { 1.0, 0.8, 1.0, 0.0 }; … … 313 312 314 313 glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); 315 // 314 // glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR); 316 315 glEnable(GL_COLOR_MATERIAL); 317 316 318 glShadeModel( GL_FLAT);317 glShadeModel(GL_FLAT); 319 318 } 320 319 … … 712 711 glColor3f(0.6f, 0.6f, 0.6f); 713 712 RenderPvs(); 713 } 714 715 if (1 && mShowRays) 716 { 717 RenderRays(mViewCellsManager->mVizBuffer.GetRays()); 714 718 } 715 719 } … … 1151 1155 if (mViewCellsManager) 1152 1156 { 1157 const float f = number / 1000.0f; 1153 1158 AxisAlignedBox3 box = mViewCellsManager->GetViewSpaceBox(); 1154 Vector3 p = box.Min() + (number/1000.0f)*box.Max();1159 Vector3 p = (1.0f - f) * box.Min() + f * box.Max(); 1155 1160 mSceneCutPlane.mNormal = Vector3(0,-1,0); 1156 1161 mSceneCutPlane.mD = -DotProd(mSceneCutPlane.mNormal, p); … … 1278 1283 ViewCell *vc = viewcells[i]; 1279 1284 1280 if (mShowPvsSizes) // pv 1285 if (mShowPvsSizes) // pvs size 1281 1286 { 1282 1287 //const int p = vc->GetPvs().CountObjectsInPvs(); … … 1336 1341 { 1337 1342 //glDisable(GL_CULL_FACE); 1338 //glEnable(GL_CULL_FACE);1339 //glFrontFace(GL_CCW);1340 1343 //glCullFace(GL_BACK); 1344 1341 1345 if (!mUseTransparency) 1342 1346 { … … 1346 1350 else 1347 1351 { 1348 //glCullFace(GL_BACK);1349 //cout << "here29 " << mTransparency << endl;1350 1352 glDisable(GL_DEPTH_TEST); 1351 1353 glEnable(GL_BLEND); … … 1410 1412 glEnable(GL_DEPTH_TEST); 1411 1413 } 1414 1415 glEnable(GL_CULL_FACE); 1416 glDisable(GL_CULL_FACE); 1417 1418 glDisable(GL_CLIP_PLANE0); 1412 1419 1413 1420 mUseFalseColors = false; -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
r2569 r2571 16 16 #include "RssPreprocessor.h" 17 17 #include "SceneGraph.h" 18 #include "ViewCellsManager.h" 18 19 19 20 … … 50 51 51 52 // This method has to be rendefined by all renderer implementations 52 void 53 QtGlViewer::RenderScene() 54 { 53 void QtGlViewer::RenderScene() 54 { 55 GLfloat mat_ambient[] = {0.1, 0.1, 0.1, 1.0}; 56 57 // mat_specular and mat_shininess are NOT default values 58 GLfloat mat_diffuse[] = {0.5, 1.0, 0.5, 1.0}; 59 GLfloat mat_specular[] = {0.3, 0.3, 0.3, 1.0}; 60 GLfloat mat_shininess[] = {1.0}; 61 62 GLfloat light_ambient[] = {0.1, 0.1, 0.1, 1.0}; 63 GLfloat light_diffuse[] = {0.5, 0.5, 0.5, 1.0}; 64 GLfloat light_specular[] = {0.0, 0.0, 0.0, 1.0}; 65 66 GLfloat lmodel_ambient[] = {0.2, 0.2, 0.2, 1.0}; 67 68 69 // default material 70 /*glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient); 71 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); 72 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); 73 glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); 74 */ 75 // a light 76 glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); 77 glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); 78 glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 79 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 80 81 82 //GLfloat infinite_light2[] = {-0.3, 1.5f, 1.0f, 0.0f}; 83 //glLightfv (GL_LIGHT1, GL_POSITION, infinite_light2); 84 glColor3f(0.8f, 0.8f, 0.8f); 85 86 glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); 87 glDisable(GL_COLOR_MATERIAL); 88 //glEnable(GL_COLOR_MATERIAL); 89 55 90 ++ mRenderer->mFrame; 56 91 57 //glDisable(GL_DEPTH_TEST); 92 glEnable(GL_DEPTH_TEST); 93 glDepthMask(GL_TRUE); 94 95 glCullFace(GL_BACK); 96 glShadeModel(GL_FLAT); 97 98 glDisable(GL_BLEND); 58 99 59 100 mRenderer->mDummyViewPoint = mDummyViewPoint; 60 glColor3f(0.8f, 0.8f, 0.8f); 101 102 //glEnable(GL_LIGHTING); 103 61 104 mRenderer->RenderPvs(); 62 105 63 // if (mRenderer->mShowRays) { 64 // RssPreprocessor *p = (RssPreprocessor *) 65 // mRenderer->mViewCellsManager->GetPreprocessor(); 66 // if (p->mRssTree) { 67 // VssRayContainer rays; 68 // p->mRssTree->CollectRays(rays, 10000); 69 // mRenderer->RenderRays(rays); 70 // } 71 // } 106 glDisable(GL_LIGHTING); 107 108 if (0 && mRenderer->mShowRays) 109 { 110 mRenderer->RenderRays(mRenderer->mViewCellsManager->mVizBuffer.GetRays()); 111 } 72 112 73 113 if (mRenderer->mShowRenderCost) … … 101 141 << "Info: GL Extensions = "<<extString<<endl<<flush; 102 142 143 144 glEnable(GL_LIGHTING); 145 glEnable(GL_LIGHT0); 146 //glEnable(GL_LIGHT1); 147 148 // set position of the light 149 GLfloat infinite_light[] = {0, -1.0, 0, 1.0f}; 150 glLightfv(GL_LIGHT0, GL_POSITION, infinite_light); 103 151 104 152 return;
Note: See TracChangeset
for help on using the changeset viewer.