Index: orxonox/trunk/src/lib/collision_detection/bv_tree.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/bv_tree.h	(revision 4619)
+++ orxonox/trunk/src/lib/collision_detection/bv_tree.h	(revision 4622)
@@ -1,3 +1,3 @@
-/*! 
+/*!
     \file bv_tree.h
     \brief Definition of a bounding volume tree
@@ -27,7 +27,7 @@
 
 
-  virtual void drawBV(int currentDepth, const int depth) const = NULL;
-  virtual void drawBVPolygon(int currentDepth, const int depth) const = NULL;
-  virtual void drawBVBlended(int currentDepth, const int depth) const = NULL;
+  virtual void drawBV(int depth) const = NULL;
+  virtual void drawBVPolygon(int depth) const = NULL;
+  virtual void drawBVBlended(int depth) const = NULL;
 
  protected:
Index: orxonox/trunk/src/lib/collision_detection/cd_engine.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/cd_engine.cc	(revision 4619)
+++ orxonox/trunk/src/lib/collision_detection/cd_engine.cc	(revision 4622)
@@ -53,16 +53,16 @@
 
 
-void CDEngine::drawBV(int currentDepth, const int depth) const
+void CDEngine::drawBV(int depth) const
 {
   /* this would operate on  worldList bases, for testing purposes, we only use one OBBTree */
-  this->rootTree->drawBV(currentDepth, depth);
+  this->rootTree->drawBV(depth);
 }
 
 
-void CDEngine::drawBVPolygon(int currentDepth, const int depth) const
+void CDEngine::drawBVPolygon(int depth) const
 {}
 
 
-void CDEngine::drawBVBlended(int currentDepth, const int depth) const
+void CDEngine::drawBVBlended(int depth) const
 {}
 
Index: orxonox/trunk/src/lib/collision_detection/cd_engine.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/cd_engine.h	(revision 4619)
+++ orxonox/trunk/src/lib/collision_detection/cd_engine.h	(revision 4622)
@@ -44,7 +44,7 @@
   void disable(const int options) { int temp = this->state & options; this->state ^= temp; }
 
-  void drawBV(int currentDepth, const int depth) const;
-  void drawBVPolygon(int currentDepth, const int depth) const;
-  void drawBVBlended(int currentDepth, const int depth) const;
+  void drawBV(int depth) const;
+  void drawBVPolygon(int depth) const;
+  void drawBVBlended(int depth) const;
 
   void checkCollisions();
Index: orxonox/trunk/src/lib/collision_detection/obb_tree.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree.cc	(revision 4619)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree.cc	(revision 4622)
@@ -26,6 +26,4 @@
 
 
-Material* OBBTree::material = NULL;
-
 /**
    \brief standard constructor
@@ -34,7 +32,14 @@
 {
   this->setClassID(CL_OBB_TREE, "OBBTree");
-  material = new Material("Tree");
-  material->setIllum(3);
-  material->setAmbient(1.0, 1.0, 1.0);
+
+  material = new Material*[3];
+  for(int i = 0; i < 3; ++i)
+  {
+    material[i] = new Material();
+    material[i]->setIllum(0);
+  }
+  material[0]->setAmbient(0.0, 0.3, 0.0);
+  material[1]->setAmbient(0.0, 0.0, 0.2);
+  material[2]->setAmbient(1.0, 0.0, 0.0);
 }
 
@@ -59,4 +64,5 @@
   OBBTreeNode* node = new OBBTreeNode();
   this->rootNode = node;
+  this->rootNode->setTreeRef(this);
   this->rootNode->spawnBVTree(depth, verticesList, length);
 }
@@ -71,25 +77,25 @@
 
 
-void OBBTree::drawBV(int currentDepth, const int depth) const
+void OBBTree::drawBV(int depth) const
 {
   if( likely(this->rootNode != NULL))
   {
-    this->rootNode->drawBV(currentDepth);
-    this->rootNode->drawBVPolygon(currentDepth);
+    this->rootNode->drawBV(depth);
+    this->rootNode->drawBVPolygon(depth);
   }
 }
 
 
-void OBBTree::drawBVPolygon(int currentDepth, const int depth) const
+void OBBTree::drawBVPolygon(int depth) const
 {
   if( likely(this->rootNode != NULL))
-    this->rootNode->drawBVPolygon(currentDepth);
+    this->rootNode->drawBVPolygon(depth);
 }
 
 
-void OBBTree::drawBVBlended(int currentDepth, const int depth) const
+void OBBTree::drawBVBlended(int depth) const
 {
   if( likely(this->rootNode != NULL))
-    this->rootNode->drawBVBlended(currentDepth);
+    this->rootNode->drawBVBlended(depth);
 }
 
Index: orxonox/trunk/src/lib/collision_detection/obb_tree.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree.h	(revision 4619)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree.h	(revision 4622)
@@ -27,16 +27,19 @@
     void collideWith(const OBBTree &tree);
 
-    virtual void drawBV(int currentDepth, const int depth) const;
-    virtual void drawBVPolygon(int currentDepth, const int depth) const;
-    virtual void drawBVBlended(int currentDepth, const int depth) const;
+    virtual void drawBV(int depth) const;
+    virtual void drawBVPolygon(int depth) const;
+    virtual void drawBVBlended(int depth) const;
+
+    Material* getMaterial(unsigned int depth) { return material[depth%3]; }
 
     void debug();
 
   public:
-    static Material* material;
+
 
 
   private:
     OBBTreeNode*         rootNode;                        //!< reference to the root node of the tree
+    Material**           material;
 
 };
Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4619)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4622)
@@ -41,4 +41,5 @@
 using namespace std;
 
+OBBTree*  OBBTreeNode::obbTree = NULL;
 
 /**
@@ -391,13 +392,13 @@
 void OBBTreeNode::drawBV(int depth) const
 {
-//   glBegin(GL_LINE_LOOP);
-//   glColor3f(1.0, 1.0, 1.0);
-//   for(int i = 0; i < this->bvElement->numOfVertices; ++i)
-//     {
-//       glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
-//       //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]);
-//     }
-//   glEnd();
-  //this->drawBVPolygon(currentDepth, depth);
+  glBegin(GL_TRIANGLES);
+  glColor3f(1.0, 1.0, 1.0);
+  for(int i = 0; i < this->bvElement->numOfVertices; ++i)
+    {
+      glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
+      //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]);
+    }
+  glEnd();
+  //this->drawBVPolygon(depth);
 }
 
@@ -405,6 +406,7 @@
 void OBBTreeNode::drawBVPolygon(int depth) const
 {
-
-  OBBTree::material->select();
+  //OBBTree::material->select();
+
+  this->obbTree->getMaterial(depth)->select();
 
   /* draw world axes */
@@ -520,8 +522,8 @@
   glEnd();
 
-  if( this->nodeLeft != NULL && depth != 0)
-    this->nodeLeft->drawBVPolygon(depth -1);
+  if( this->nodeLeft != NULL && depth != 0 )
+    this->nodeLeft->drawBVPolygon(depth - 1);
   if( this->nodeRight != NULL && depth != 0)
-    this->nodeRight->drawBVPolygon(depth -1);
+    this->nodeRight->drawBVPolygon(depth - 1);
 
 }
Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4619)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4622)
@@ -15,4 +15,5 @@
 class BoundingVolume;
 class OBB;
+class OBBTree;
 //struct sVec3D;
 
@@ -29,4 +30,5 @@
     BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; }
     inline const int getIndex() { return this->treeIndex; }
+    inline void setTreeRef(OBBTree* tree) { this->obbTree = tree;}
 
     virtual void collideWith(const BVTree &tree);
@@ -55,5 +57,5 @@
     int                 numOfVertices;              //!< number of vertices in vertices data
     int                 depth;                      //!< the depth of the node in the tree
-
+    static OBBTree*     obbTree;                    //!< reference to the obb tree
 };
 
