Index: trunk/src/lib/collision_detection/bv_tree.h
===================================================================
--- trunk/src/lib/collision_detection/bv_tree.h	(revision 5479)
+++ trunk/src/lib/collision_detection/bv_tree.h	(revision 5481)
@@ -45,4 +45,5 @@
   virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2) = 0;
 
+  /** @param depth: depth, @param drawMode: how to draw the Model */
   virtual void drawBV(int depth, int drawMode) const = 0;
 
Index: trunk/src/lib/collision_detection/bv_tree_node.h
===================================================================
--- trunk/src/lib/collision_detection/bv_tree_node.h	(revision 5479)
+++ trunk/src/lib/collision_detection/bv_tree_node.h	(revision 5481)
@@ -10,4 +10,5 @@
 #include "base_object.h"
 #include "abstract_model.h"
+#include "vector.h"
 
 // FORWARD DECLARATION
@@ -32,5 +33,5 @@
   virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) = 0;
 
-  virtual void drawBV(int depth, int drawMode) = 0;
+  virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const = 0;
 
 
Index: trunk/src/lib/collision_detection/obb_tree.cc
===================================================================
--- trunk/src/lib/collision_detection/obb_tree.cc	(revision 5479)
+++ trunk/src/lib/collision_detection/obb_tree.cc	(revision 5481)
@@ -49,35 +49,4 @@
 
   this->rootNode = NULL;
-
-  material = new Material*[5];
-  for(int i = 0; i < 5; ++i)
-  {
-    material[i] = new Material();
-    material[i]->setIllum(3);
-  }
-  material[0]->setAmbient(0.0, 0.3, 0.0);
-  material[1]->setAmbient(0.4, 0.0, 0.2);
-  material[2]->setAmbient(1.0, 0.0, 0.0);
-  material[3]->setAmbient(5.0, 3.0, 1.0);
-  material[4]->setAmbient(1.0, 0.0, 7.0);
-
-
-  transparentMaterial = new Material*[5];
-  for(int i = 0; i < 5; ++i)
-  {
-    transparentMaterial[i] = new Material();
-    transparentMaterial[i]->setIllum(3);
-    transparentMaterial[i]->setTransparency(0.2);
-  }
-  transparentMaterial[0]->setAmbient(0.0, 0.3, 0.0);
-  transparentMaterial[1]->setAmbient(0.4, 0.0, 0.2);
-  transparentMaterial[2]->setAmbient(1.0, 0.0, 0.0);
-  transparentMaterial[3]->setAmbient(5.0, 3.0, 1.0);
-  transparentMaterial[4]->setAmbient(1.0, 0.0, 7.0);
-
-  this->collisionMaterial = new Material();
-  this->collisionMaterial->setIllum(5);
-  this->collisionMaterial->setTransparency(0.5);
-  this->collisionMaterial->setAmbient(1.0, 1.0, 1.0);
 
   this->id = 0;
Index: trunk/src/lib/collision_detection/obb_tree.h
===================================================================
--- trunk/src/lib/collision_detection/obb_tree.h	(revision 5479)
+++ trunk/src/lib/collision_detection/obb_tree.h	(revision 5481)
@@ -33,8 +33,4 @@
     virtual void drawBV(int depth, int drawMode) const;
 
-    Material* getMaterial(unsigned int depth) { return this->material[depth%5]; }
-    Material* getTransparentMaterial(unsigned int depth) { return this->transparentMaterial[depth%5]; }
-    Material* getCollisionMaterial() { return this->collisionMaterial; }
-
     int getID() { return ++this->id;}
     inline OBBTreeNode* getRootNode() { return this->rootNode; }
@@ -42,13 +38,6 @@
     void debug();
 
-  public:
-
-
-
   private:
     OBBTreeNode*         rootNode;                        //!< reference to the root node of the tree
-    Material**           material;
-    Material**           transparentMaterial;
-    Material*            collisionMaterial;
     int                  id;
 };
Index: trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 5479)
+++ trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 5481)
@@ -25,7 +25,7 @@
 
 #include <math.h>
+#include "color.h"
 
 #include "stdincl.h"
-
 #include "lin_alg.h"
 #include "glincl.h"
@@ -806,7 +806,6 @@
 
 
-void OBBTreeNode::drawBV(int depth, int drawMode)
+void OBBTreeNode::drawBV(int depth, int drawMode, const Vector& color,  bool top) const
 {
-  this->obbTree->getMaterial(treeIndex)->select();
 
   /* draw the model itself, there is some problem concerning this: the vertices are drawn multiple times */
@@ -834,4 +833,13 @@
   }
 
+  if (top)
+  {
+    glPushAttrib(GL_ENABLE_BIT);
+    glDisable(GL_LIGHTING);
+    glDisable(GL_TEXTURE_2D);
+    glDisable(GL_BLEND);
+  }
+  glColor3f(color.x, color.y, color.z);
+
 
   /* draw world axes */
@@ -839,11 +847,13 @@
   {
     glBegin(GL_LINES);
-    glColor3f(0.0, 0.4, 0.3);
+    glColor3f(1.0, 0.0, 0.0);
     glVertex3f(0.0, 0.0, 0.0);
     glVertex3f(3.0, 0.0, 0.0);
 
+    glColor3f(0.0, 1.0, 0.0);
     glVertex3f(0.0, 0.0, 0.0);
     glVertex3f(0.0, 3.0, 0.0);
 
+    glColor3f(0.0, 0.0, 1.0);
     glVertex3f(0.0, 0.0, 0.0);
     glVertex3f(0.0, 0.0, 3.0);
@@ -890,7 +900,11 @@
 
     if( this->bvElement->bCollided)
-      this->obbTree->getCollisionMaterial()->select();
+    {
+      glColor3f(1.0, 1.0, 1.0); // COLLISION COLOR
+    }
     else if( drawMode & DRAW_BV_BLENDED)
-      this->obbTree->getTransparentMaterial(treeIndex)->select();
+    {
+      glColor4f(color.x, color.y, color.z, .5);
+    }
 
 
@@ -1005,5 +1019,5 @@
 
     if( drawMode & DRAW_BV_BLENDED)
-      this->obbTree->getMaterial(treeIndex)->select();
+      glColor3f(color.x, color.y, color.z);
     }
 
@@ -1016,5 +1030,5 @@
     {
       if( drawMode & DRAW_BV_BLENDED)
-        this->obbTree->getTransparentMaterial(treeIndex)->select();
+        glColor4f(color.x, color.y, color.z, .6);
 
     /* now draw the separation plane */
@@ -1032,17 +1046,23 @@
 
     if( drawMode & DRAW_BV_BLENDED)
-      this->obbTree->getMaterial(treeIndex)->select();
-
-    }
-  }
-
-
-
-  if( this->nodeLeft != NULL && depth != 0 )
-    this->nodeLeft->drawBV(depth - 1, drawMode);
-  if( this->nodeRight != NULL && depth != 0)
-    this->nodeRight->drawBV(depth - 1, drawMode);
-
+      glColor4f(color.x, color.y, color.z, 1.0);
+
+    }
+  }
+
+
+
+  if (depth > 0)
+  {
+    Vector childColor =  Color::HSVtoRGB(Color::RGBtoHSV(color)+Vector(20,0,.0));
+    if( this->nodeLeft != NULL)
+      this->nodeLeft->drawBV(depth - 1, drawMode, childColor, false);
+    if( this->nodeRight != NULL)
+      this->nodeRight->drawBV(depth - 1, drawMode, childColor, false);
+  }
   this->bvElement->bCollided = false;
+
+  if (top)
+    glPopAttrib();
 }
 
Index: trunk/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- trunk/src/lib/collision_detection/obb_tree_node.h	(revision 5479)
+++ trunk/src/lib/collision_detection/obb_tree_node.h	(revision 5481)
@@ -36,5 +36,5 @@
     virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB);
 
-    virtual void drawBV(int depth, int drawMode);
+    virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const;
 
     void debug() const;
