Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4626 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jun 13, 2005, 11:30:58 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: fight for a working lin alg jacobi decomposition algorithm.

Location:
orxonox/trunk/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4622 r4626  
    6565  this->rootNode = node;
    6666  this->rootNode->setTreeRef(this);
    67   this->rootNode->spawnBVTree(depth, verticesList, length);
     67  this->rootNode->spawnBVTree(--depth, verticesList, length);
    6868}
    6969
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4622 r4626  
    7171void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, const int length)
    7272{
     73  printf("OBB Depth: %i\n", depth);
    7374  this->depth = depth;
    7475
    7576  this->bvElement = this->createBox();
     77  PRINTF(0)("Created OBBox\n");
    7678  this->calculateBoxAttributes(this->bvElement, verticesList, length);
     79  PRINTF(0)("Calculated attributes\n");
    7780
    7881  if( likely( this->depth > 0))
    7982  {
    8083    this->forkBox(this->bvElement);
     84
    8185  }
    8286}
     
    126130  /* take the average of the centroid sum */
    127131  center /= face;
    128 
     132  PRINTF(0)("-- Calculated Center\n");
    129133
    130134
     
    145149    }
    146150  }
    147 
    148   printf("\nVertex Data:\n");
    149   for(int i = 0; i < length; i++)
    150   {
    151     printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);
    152   }
     151  PRINTF(0)("-- Calculated Covariance\n");
     152
     153//   printf("\nVertex Data:\n");
     154//   for(int i = 0; i < length; i++)
     155//   {
     156//     printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);
     157//   }
    153158
    154159  printf("\nCovariance Matrix:\n");
     
    173178  }
    174179  *box->center = center;
    175 
     180  PRINTF(0)("-- Written Result to obb\n");
    176181
    177182  /* now getting spanning vectors of the sub-space:
     
    197202
    198203  Jacobi(C, D, V);                                            /* do the jacobi decomposition */
    199 
    200   printf("\nwe got a result! YES: \n");
    201 
    202   for(int j = 1; j < 4; ++j)
    203   {
    204     printf(" |");
    205     for(int k = 1; k < 4; ++k)
    206     {
    207       printf(" \b%f ", V(j, k));
    208     }
    209     printf(" |\n");
    210   }
     204  PRINTF(0)("-- Done Jacobi Decomposition\n");
     205
     206//   printf("\nwe got a result! YES: \n");
     207//
     208//   for(int j = 1; j < 4; ++j)
     209//   {
     210//     printf(" |");
     211//     for(int k = 1; k < 4; ++k)
     212//     {
     213//       printf(" \b%f ", V(j, k));
     214//     }
     215//     printf(" |\n");
     216//   }
    211217
    212218  axis[0] = new Vector(V(1, 1), V(2, 1), V(3, 1));
     
    214220  axis[2] = new Vector(V(1, 3), V(2, 3), V(3, 3));
    215221  box->axis = axis;
    216 
    217   printf("\neigenvector: %f, %f, %f\n", box->axis[0]->x, box->axis[0]->y, box->axis[0]->z);
    218   printf("eigenvector: %f, %f, %f\n", box->axis[1]->x, box->axis[1]->y, box->axis[1]->z);
    219   printf("eigenvector: %f, %f, %f\n", box->axis[2]->x, box->axis[2]->y, box->axis[2]->z);
     222  PRINTF(0)("-- Got Axis\n");
     223
     224//   delete &V;
     225//   delete &D;
     226//   delete &V;
     227
     228//   printf("\neigenvector: %f, %f, %f\n", box->axis[0]->x, box->axis[0]->y, box->axis[0]->z);
     229//   printf("eigenvector: %f, %f, %f\n", box->axis[1]->x, box->axis[1]->y, box->axis[1]->z);
     230//   printf("eigenvector: %f, %f, %f\n", box->axis[2]->x, box->axis[2]->y, box->axis[2]->z);
    220231
    221232
     
    253264
    254265  box->halfLength = halfLength;
    255 
    256 
    257   printf("\nwe got length: \n");
    258   for(int i = 0; i < 3; ++i)
    259     printf("length[%i] = %f\n", i, box->halfLength[i]);
     266  PRINTF(0)("-- Written Axis to obb\n");
     267
     268
     269//   printf("\nwe got length: \n");
     270//   for(int i = 0; i < 3; ++i)
     271//     printf("length[%i] = %f\n", i, box->halfLength[i]);
    260272}
    261273
     
    346358  }
    347359
    348   printf("\npartition 1:\n");
    349   for(int i = 0; i < partition1.getSize(); ++i)
    350   {
    351     printf("v[%i][0] = %f\n", i, vertList1[i][0]);
    352     printf("v[%i][1] = %f\n", i, vertList1[i][1]);
    353     printf("v[%i][2] = %f\n", i, vertList1[i][2]);
    354   }
     360//   printf("\npartition 1:\n");
     361//   for(int i = 0; i < partition1.getSize(); ++i)
     362//   {
     363//     printf("v[%i][0] = %f\n", i, vertList1[i][0]);
     364//     printf("v[%i][1] = %f\n", i, vertList1[i][1]);
     365//     printf("v[%i][2] = %f\n", i, vertList1[i][2]);
     366//   }
    355367
    356368  iterator = partition2.getIterator();
     
    366378  }
    367379
    368   printf("\npartition 2:\n");
    369   for(int i = 0; i < partition2.getSize(); ++i)
    370   {
    371     printf("v[%i][0] = %f\n", i, vertList2[i][0]);
    372     printf("v[%i][1] = %f\n", i, vertList2[i][1]);
    373     printf("v[%i][2] = %f\n", i, vertList2[i][2]);
    374   }
     380  //delete iterator;
     381//   printf("\npartition 2:\n");
     382//   for(int i = 0; i < partition2.getSize(); ++i)
     383//   {
     384//     printf("v[%i][0] = %f\n", i, vertList2[i][0]);
     385//     printf("v[%i][1] = %f\n", i, vertList2[i][1]);
     386//     printf("v[%i][2] = %f\n", i, vertList2[i][2]);
     387//   }
    375388
    376389  /* now spawn the obb tree: create the nodes and descent */
     
    386399
    387400
     401
     402
    388403void OBBTreeNode::collideWith(const BVTree &tree)
    389404{}
     405
     406
    390407
    391408
  • orxonox/trunk/src/subprojects/collision_detection/Makefile.am

    r4616 r4626  
    1313                  $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS) \
    1414                  -lpthread
     15
     16
    1517
    1618collision_CPPFLAGS =  -DGUI_MODULE \
     
    3941                   $(MAINSRCDIR)/lib/coord/p_node.cc \
    4042                   $(MAINSRCDIR)/lib/coord/null_parent.cc \
    41                    $(MAINSRCDIR)/lib/gui/gui_gtk.cc \
    4243                   $(MAINSRCDIR)/lib/newmat/include.h \
    4344                   $(MAINSRCDIR)/lib/newmat/newmat.h \
    4445                   $(MAINSRCDIR)/lib/newmat/newmatap.h \
    45                    $(MAINSRCDIR)/lib/newmatio.h
     46                   $(MAINSRCDIR)/lib/newmatio.h \
     47                   $(MAINSRCDIR)/lib/gui/gui_gtk.cc
  • orxonox/trunk/src/subprojects/collision_detection/Makefile.in

    r4616 r4626  
    256256                   $(MAINSRCDIR)/lib/coord/p_node.cc \
    257257                   $(MAINSRCDIR)/lib/coord/null_parent.cc \
    258                    $(MAINSRCDIR)/lib/gui/gui_gtk.cc \
    259258                   $(MAINSRCDIR)/lib/newmat/include.h \
    260259                   $(MAINSRCDIR)/lib/newmat/newmat.h \
    261260                   $(MAINSRCDIR)/lib/newmat/newmatap.h \
    262                    $(MAINSRCDIR)/lib/newmatio.h
     261                   $(MAINSRCDIR)/lib/newmatio.h \
     262                   $(MAINSRCDIR)/lib/gui/gui_gtk.cc
    263263
    264264all: all-am
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4622 r4626  
    3535  model = new MD2Model("models/tris.md2", "models/tris.pcx");
    3636  model->tick(0.1f);
    37   CDEngine::getInstance()->debugSpawnTree(1, model->data->pVertices, model->data->numVertices);
     37  CDEngine::getInstance()->debugSpawnTree(10, model->data->pVertices, model->data->numVertices);
     38
    3839
    3940  LightManager* lightMan = LightManager::getInstance();
     
    8788void Framework::moduleInitGui(int argc, char** argv)
    8889{
    89 //   Window* guiMainWindow = NULL;
    90 //
    91 //   initGUI(0, NULL);
    92 //
    93 //   guiMainWindow = new Window("Collision_detection");
    94 //   {
    95 //     // all the Widgets you need
    96 //   }
    97 //   Window::mainWindow->showall();
    98 //   Window::mainWindow->setSize(300, 500);
     90  Window* guiMainWindow = NULL;
     91
     92  initGUI(0, NULL);
     93
     94  guiMainWindow = new Window("Collision_detection");
     95  {
     96    //all the Widgets you need
     97  }
     98  Window::mainWindow->showall();
     99  Window::mainWindow->setSize(300, 500);
    99100}
Note: See TracChangeset for help on using the changeset viewer.