Changeset 2710 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 05/26/08 04:01:24 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
r2709 r2710 10 10 #SCENE=../data/vienna/vienna_cropped.obj 11 11 #SCENE=../data/vienna/city_full.obj 12 SCENE=../data/vienna/city_full_hp.obj13 #SCENE=../data/vienna/vienna_rep.obj12 #SCENE=../data/vienna/city_full_hp.obj 13 SCENE=../data/vienna/vienna_rep.obj 14 14 15 15 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz … … 52 52 -preprocessor_detect_empty_viewspace+ \ 53 53 -preprocessor_use_vbos- \ 54 -preprocessor_ray_cast_method= 1\54 -preprocessor_ray_cast_method=3 \ 55 55 -view_cells_random_viewpoint_list=$VIEWPOINTS \ 56 56 demo1.env -
GTP/trunk/Lib/Vis/Preprocessing/src/HavranDynRayCaster.cpp
r2682 r2710 348 348 objI[i] = 0; 349 349 } 350 351 350 // Here we shoot first backward rays and forward ones 352 351 SimpleRayContainer::iterator sit = rays.begin() + offset; -
GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.cpp
r2705 r2710 340 340 { 341 341 Intersectable *intersect = 342 mPreprocessor.GetParentObject(backward_hit_triangles[i]);342 mPreprocessor.GetParentObject(backward_hit_triangles[i]); 343 343 344 344 if (intersect) 345 345 { 346 hitB.mObject = intersect;347 hitB.mNormal = mPreprocessor.GetParentNormal(backward_hit_triangles[i]);348 349 // normalB = rays[i].mDirection; // $$ temporary350 hitB.mPoint = rays[k].Extrap(-backward_dist[i]);346 hitB.mObject = intersect; 347 hitB.mNormal = mPreprocessor.GetParentNormal(backward_hit_triangles[i]); 348 349 // normalB = rays[i].mDirection; // $$ temporary 350 hitB.mPoint = rays[k].Extrap(-backward_dist[i]); 351 351 } 352 352 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2709 r2710 36 36 37 37 38 static int sCurrentDynamicId = 0; 39 40 38 41 inline static bool ilt(Intersectable *obj1, Intersectable *obj2) 39 42 { … … 329 332 330 333 331 Intersectable *Preprocessor::GetParentObject( constint index) const334 Intersectable *Preprocessor::GetParentObject(int index) const 332 335 { 333 336 if (index < 0) … … 351 354 else 352 355 { 353 if (index >= (int)mObjects.size()) 354 { 355 cerr<<"Warning: triangle index out of range! " << index << " of " << (int)mObjects.size() << endl; 356 return NULL; 357 } 358 else 359 { 360 return mObjects[index]; 361 } 356 return mObjects[index]; 362 357 } 363 358 } … … 733 728 } 734 729 } 730 735 731 736 732 //////// … … 1594 1590 mDynamicObjects.push_back(leaf); 1595 1591 1592 const int currentId = (int)mObjects.size() + sCurrentDynamicId; 1593 1594 leaf->GetIntersectable()->SetId(currentId); 1595 1596 for (size_t i = 0; i < leaf->mGeometry.size(); ++ i) 1597 { 1598 leaf->mGeometry[i]->SetId(currentId); 1599 } 1600 1601 cout << "\**************\n******* new object has id " << currentId << endl; 1602 1603 ++ sCurrentDynamicId; 1604 1596 1605 // tell ray caster to update 1597 1606 ScheduleUpdateDynamicObjects(); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/ObjectPlacer.cpp
r2702 r2710 58 58 } 59 59 60 61 void ObjectPlacer::PlaceObject(SceneGraphLeaf *leaf, const Vector3 &pt) 62 { 63 AxisAlignedBox3 box = leaf->GetBox(); 64 65 Vector3 p = box.Center() - pt;; 66 67 // set pivot to ground of object 68 //p.y -= obj->GetOriginalBox().Min().y; 69 Matrix4x4 trafo = TranslationMatrix(p); 70 71 leaf->ApplyTransform(trafo); 60 72 } 73 74 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/ObjectPlacer.h
r2702 r2710 33 33 */ 34 34 void PlaceObject(const Vector3 &p); 35 /** Adds an object at the indicated position. 36 */ 37 void PlaceObject(SceneGraphLeaf *l, const Vector3 &p); 35 38 /** Returns the currently active object. 36 39 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2709 r2710 143 143 glLoadIdentity(); 144 144 glOrtho(-1, 1, -1, 1, -99, 99); 145 //glTranslatef(-0.5f, -0.5f, 0.0f);146 145 glMatrixMode(GL_MODELVIEW); 147 146 glLoadIdentity(); … … 916 915 { 917 916 Matrix4x4 tm; 917 918 SceneGraphLeaf *l = 919 mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 918 920 919 921 switch (mTrafoType) … … 948 950 cerr << "not implemented" << endl; 949 951 } 950 951 SceneGraphLeaf *l = 952 mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 952 953 953 l->ApplyTransform(tm); 954 954 955 955 updateGL(); 956 956 } … … 1184 1184 mCurrentDynamicObjectIdx = -1; 1185 1185 1186 // export frame buffer during walkthrough 1186 1187 //mExportFrameBuffer = true; 1187 1188 mExportFrameBuffer = false; -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
r2709 r2710 281 281 { 282 282 mTrafo = IdentityMatrix(); 283 284 283 mIntersectable = new SceneGraphLeafIntersectable(this, mBox); 285 284 } … … 289 288 { 290 289 mTrafo = IdentityMatrix(); 290 mIntersectable = new SceneGraphLeafIntersectable(this, mBox); 291 291 } 292 292 … … 336 336 mTrafo = copy.mTrafo; 337 337 mIsDynamic = copy.mIsDynamic; 338 339 mIntersectable = new SceneGraphLeafIntersectable(this, mBox); 338 340 mHasChanged = true; 339 341 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2705 r2710 369 369 { 370 370 // dynamic objects are scene graph leaves 371 if (ray.mTerminationObject->Type() == Intersectable::SCENEGRAPHLEAF_INTERSECTABLE) 371 const int index = ray.mTerminationObject->GetId(); 372 if (index >= mPreprocessor->mObjects.size()) 373 { 374 for (size_t i = 0; i < mPreprocessor->mDynamicObjects.size(); ++ i) 375 { 376 Intersectable *obj = mPreprocessor->mDynamicObjects[i]->GetIntersectable(); 377 if (obj->GetId() == index) 378 return obj; 379 } 380 372 381 return ray.mTerminationObject; 382 } 373 383 374 384 if (mUseKdPvs)
Note: See TracChangeset
for help on using the changeset viewer.