Index: /orxonox/trunk/src/lib/collision_detection/bounding_volume.cc
===================================================================
--- /orxonox/trunk/src/lib/collision_detection/bounding_volume.cc	(revision 4556)
+++ /orxonox/trunk/src/lib/collision_detection/bounding_volume.cc	(revision 4557)
@@ -27,4 +27,5 @@
 {
    this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume"); 
+   this->center = new Vector();
 
 }
@@ -38,3 +39,4 @@
 {
   // delete what has to be deleted here
+  delete this->center;
 }
Index: /orxonox/trunk/src/lib/collision_detection/bounding_volume.h
===================================================================
--- /orxonox/trunk/src/lib/collision_detection/bounding_volume.h	(revision 4556)
+++ /orxonox/trunk/src/lib/collision_detection/bounding_volume.h	(revision 4557)
@@ -35,5 +35,6 @@
   Vector*             center;                     //!< Center point of box
 
-  tList<sVect3D>*     verticesBuffer;             //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
+  sVect3D*            vertices;                   //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
+  int                 numOfVertices;              //!< number of vertices in the vertices buffer
 };
 
Index: /orxonox/trunk/src/lib/collision_detection/obb.cc
===================================================================
--- /orxonox/trunk/src/lib/collision_detection/obb.cc	(revision 4556)
+++ /orxonox/trunk/src/lib/collision_detection/obb.cc	(revision 4557)
@@ -18,4 +18,5 @@
 #include "obb.h"
 #include "list.h"
+#include "vector.h"
 
 using namespace std;
@@ -28,4 +29,6 @@
 {
    this->setClassID(CL_OBB, "OBB"); 
+   this->axis = new Vector[3];
+   this->halfLength = new float[3];
 }
 
@@ -38,4 +41,6 @@
 {
   // delete what has to be deleted here
+  delete [] this->axis;
+  delete [] this->halfLength;
 }
 
Index: /orxonox/trunk/src/lib/collision_detection/obb.h
===================================================================
--- /orxonox/trunk/src/lib/collision_detection/obb.h	(revision 4556)
+++ /orxonox/trunk/src/lib/collision_detection/obb.h	(revision 4557)
@@ -32,10 +32,9 @@
 
 
- private:
+ public:
   Vector*          axis;                       //!< Axes of oriented box [x,y,z]
-  sVect3D*         halfLength;                 //!< Half lengths of the box
+  float*           halfLength;                 //!< Half lengths of the box along the axis
+  float            covarianceMatrix[3][3];     //!< the covariance matrix
 
-  OBB*             leftNode;                   //!< left node of the tree
-  OBB*             rightNode;                  //!< right node of the tree
 };
 
Index: /orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- /orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4556)
+++ /orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4557)
@@ -55,9 +55,22 @@
 void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, const int length)
 {
+  this->bvElement = this->createBox();
+  this->calculateBoxAttributes(box);
+  this->forkBox(box);
+}
+
+
+OBB* OBBTreeNode::createBox()
+{
+  return new OBB();
+}
+
+
+void OBBTreeNode::calculateBoxAttributes(OBB* box)
+{
   float     facelet[length];                         //!< surface area of the i'th triangle of the convex hull
   float     face;                                    //!< surface area of the entire convex hull
   Vector    centroid[length];                        //!< centroid of the i'th convex hull  
-  Vector    centre;                                  //!< the centre of the entire hull
-  OBB*      obb = new OBB();                         //!< the new obb to add
+  Vector    center;                                  //!< the center of the entire hull
   Vector    p, q, r;                                 //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d
   Vector    t1, t2;                                  //!< temporary values
@@ -85,8 +98,8 @@
       centroid[i] = (p + q + r) * 1/3;
       /* now calculate the centroid of the entire convex hull, weighted average of triangle centroids */
-      centre += centroid[i] * facelet[i];
+      center += centroid[i] * facelet[i];
     }
   /* take the average of the centroid sum */
-  centre /= face;
+  center /= face;
   
   /* now calculate the covariance matrix - if not written in three for-loops, it would compute faster: minor */
@@ -102,9 +115,9 @@
 
 	      covariance[j][k] = facelet[i] / (12.0f * face) * (9.0f * centroid[i][j] * centroid[i][k] + p[j]* p[k] +
-								q[j] * q[k] + r[j]*r[k]) - centre[j] * centre[k];
+								q[j] * q[k] + r[j]*r[k]) - center[j] * center[k];
 	    }
 	}
     }
-
+  
   printf("Covariance Matrix:\n");
   for(int j = 0; j < 3; ++j)
@@ -123,4 +136,37 @@
       printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);
     }
+
+
+    
+  box->covarianceMatrix = covariance;
+  box->center = center;
+
+
+  /* now getting spanning vectors of the sub-space:
+     the eigenvectors of a symmertric matrix, such as the
+     covarience matrix are mutually orthogonal.
+     after normalizing them, they can be used as a the basis 
+     vectors
+  */
+  
+
+}
+
+
+void OBBTreeNode::forkBox(OBB* box)
+{
+  /* get the longest axis of the box */
+  float aLength = -1.0f;
+  int axisNr = 0;
+  for(int i = 0; i < 3; ++i)
+    {
+      if( aLength < box->axis[i])
+	{
+	  aLength = box->axis[i];
+	  axisNr = i;
+	}
+    }
+  
+  /* get the closest vertex near the center */
   
 }
@@ -145,5 +191,11 @@
 
 void OBBTreeNode::drawBVPolygon(int currentDepth, const int depth) const
-{}
+{
+  this->bvElement->axis;
+  
+  glBegin(GL_TRIANGLE);
+  glVertex3f(this->bvElement->center );
+  glEnd();
+}
 
 
Index: /orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- /orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4556)
+++ /orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4557)
@@ -14,4 +14,5 @@
 // FORWARD DEFINITION
 class BoundingVolume;
+class OBB;
 //struct sVec3D;
 
@@ -35,4 +36,10 @@
   virtual void drawBVBlended(int currentDepth, const int depth) const;
 
+ private:
+  OBB* createBox();
+  void calculateBoxAttributes(OBB* box);
+  void forkBox(OBB* box);
+  
+
 
  protected:
