Index: /orxonox/trunk/src/Makefile.am
===================================================================
--- /orxonox/trunk/src/Makefile.am	(revision 5009)
+++ /orxonox/trunk/src/Makefile.am	(revision 5010)
@@ -46,5 +46,5 @@
                   util/loading/load_param.cc \
                   util/state.cc \
-		  story_entities/story_entity.cc \
+                  story_entities/story_entity.cc \
                   story_entities/campaign.cc \
                   story_entities/world.cc \
@@ -78,4 +78,5 @@
                   lib/util/ini_parser.cc \
                   lib/util/substring.cc \
+                  lib/util/color.cc \
                   lib/math/vector.cc \
                   lib/math/curve.cc \
@@ -147,4 +148,5 @@
                  lib/util/substring.h \
                  lib/util/list.h \
+                 lib/util/color.h \
                  lib/math/vector.h \
                  lib/math/curve.h \
Index: /orxonox/trunk/src/Makefile.in
===================================================================
--- /orxonox/trunk/src/Makefile.in	(revision 5009)
+++ /orxonox/trunk/src/Makefile.in	(revision 5010)
@@ -78,6 +78,7 @@
 	orxonox-render_2d.$(OBJEXT) orxonox-base_object.$(OBJEXT) \
 	orxonox-class_list.$(OBJEXT) orxonox-ini_parser.$(OBJEXT) \
-	orxonox-substring.$(OBJEXT) orxonox-vector.$(OBJEXT) \
-	orxonox-curve.$(OBJEXT) orxonox-glmenu_imagescreen.$(OBJEXT) \
+	orxonox-substring.$(OBJEXT) orxonox-color.$(OBJEXT) \
+	orxonox-vector.$(OBJEXT) orxonox-curve.$(OBJEXT) \
+	orxonox-glmenu_imagescreen.$(OBJEXT) \
 	orxonox-benchmark.$(OBJEXT)
 orxonox_OBJECTS = $(am_orxonox_OBJECTS)
@@ -95,4 +96,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-character_attributes.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-class_list.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox-color.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-crosshair.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-curve.Po \
@@ -331,4 +333,5 @@
                   lib/util/ini_parser.cc \
                   lib/util/substring.cc \
+                  lib/util/color.cc \
                   lib/math/vector.cc \
                   lib/math/curve.cc \
@@ -400,4 +403,5 @@
                  lib/util/substring.h \
                  lib/util/list.h \
+                 lib/util/color.h \
                  lib/math/vector.h \
                  lib/math/curve.h \
@@ -491,4 +495,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-character_attributes.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-class_list.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-color.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-crosshair.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-curve.Po@am__quote@
@@ -1284,4 +1289,20 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-substring.obj `if test -f 'lib/util/substring.cc'; then $(CYGPATH_W) 'lib/util/substring.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/substring.cc'; fi`
+
+orxonox-color.o: lib/util/color.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-color.o -MD -MP -MF "$(DEPDIR)/orxonox-color.Tpo" -c -o orxonox-color.o `test -f 'lib/util/color.cc' || echo '$(srcdir)/'`lib/util/color.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-color.Tpo" "$(DEPDIR)/orxonox-color.Po"; else rm -f "$(DEPDIR)/orxonox-color.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/util/color.cc' object='orxonox-color.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-color.Po' tmpdepfile='$(DEPDIR)/orxonox-color.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-color.o `test -f 'lib/util/color.cc' || echo '$(srcdir)/'`lib/util/color.cc
+
+orxonox-color.obj: lib/util/color.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-color.obj -MD -MP -MF "$(DEPDIR)/orxonox-color.Tpo" -c -o orxonox-color.obj `if test -f 'lib/util/color.cc'; then $(CYGPATH_W) 'lib/util/color.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/color.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-color.Tpo" "$(DEPDIR)/orxonox-color.Po"; else rm -f "$(DEPDIR)/orxonox-color.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/util/color.cc' object='orxonox-color.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-color.Po' tmpdepfile='$(DEPDIR)/orxonox-color.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-color.obj `if test -f 'lib/util/color.cc'; then $(CYGPATH_W) 'lib/util/color.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/color.cc'; fi`
 
 orxonox-vector.o: lib/math/vector.cc
Index: /orxonox/trunk/src/lib/coord/p_node.cc
===================================================================
--- /orxonox/trunk/src/lib/coord/p_node.cc	(revision 5009)
+++ /orxonox/trunk/src/lib/coord/p_node.cc	(revision 5010)
@@ -653,4 +653,5 @@
   }
 }
+#include "color.h"
 
 /**
@@ -707,5 +708,5 @@
     tIterator<PNode>* iterator = this->children->getIterator();
       //PNode* pn = this->children->enumerate ();
-    Vector childColor =  color - Vector(.0,.3,.3);
+    Vector childColor =  Color::RGBtoHSV(color)+Vector(-.3,.3,.2);
     PNode* pn = iterator->nextElement();
     while( pn != NULL)
Index: /orxonox/trunk/src/lib/util/color.cc
===================================================================
--- /orxonox/trunk/src/lib/util/color.cc	(revision 5010)
+++ /orxonox/trunk/src/lib/util/color.cc	(revision 5010)
@@ -0,0 +1,176 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+
+   this code has been borrowed from:
+   http://www.easyrgb.com/math.php
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "color.h"
+#include "vector.h"
+
+using namespace std;
+
+
+
+
+#include <stdio.h>
+
+// Needed by rgb2hsv()
+float Color::maxrgb(float r, float g, float b)
+{
+  float max;
+
+  if( r > g)
+    max = r;
+  else
+    max = g;
+  if( b > max )
+    max = b;
+  return( max );
+}
+
+
+// Needed by rgb2hsv()
+float Color::minrgb(float r,float g,float b)
+{
+  float min;
+
+  if( r < g)
+    min = r;
+  else
+    min = g;
+  if( b < min )
+    min = b;
+  return( min );
+}
+
+
+/* Taken from "Fund'l of 3D Computer Graphics", Alan Watt (1989)
+   Assumes (r,g,b) range from 0.0 to 1.0
+   Sets h in degrees: 0.0 to 360.;
+      s,v in [0.,1.]
+*/
+Vector Color::RGBtoHSV(const Vector& RGB)
+{
+  float r = RGB.x;
+  float g = RGB.y;
+  float b = RGB.z;
+
+  float h=0,s=1.0,v=1.0;
+  float max_v,min_v,diff,r_dist,g_dist,b_dist;
+  float undefined = 0.0;
+
+  max_v = maxrgb(r,g,b);
+  min_v = minrgb(r,g,b);
+  diff = max_v - min_v;
+  v = max_v;
+
+  if( max_v != 0 )
+    s = diff/max_v;
+  else
+    s = 0.0;
+  if( s == 0 )
+    h = undefined;
+  else {
+    r_dist = (max_v - r)/diff;
+    g_dist = (max_v - g)/diff;
+    b_dist = (max_v - b)/diff;
+    if( r == max_v )
+      h = b_dist - g_dist;
+    else
+      if( g == max_v )
+        h = 2 + r_dist - b_dist;
+    else
+      if( b == max_v )
+        h = 4 + g_dist - r_dist;
+    else
+      printf("rgb2hsv::How did I get here?\n");
+    h *= 60;
+    if( h < 0)
+      h += 360.0;
+  }
+  return Vector(h, s, v);
+}
+
+/* Taken from "Fund'l of 3D Computer Graphics", Alan Watt (1989)
+   Assumes H in degrees, s,v in [0.,1.0];
+   (r,g,b) range from 0.0 to 1.0
+*/
+Vector Color::HSVtoRGB(const Vector& HSV)
+{
+  float h = HSV.x;
+  float s = HSV.y;
+  float v = HSV.z;
+  float r=0, g=0, b=0;
+  float f,p,q,t;
+  int i;
+
+  if( s == 0 ) {
+    r = v;
+    g = v;
+    b = v;
+  }
+  else {
+    if(h == 360.)
+      h = 0.0;
+    h /= 60.;
+    i = (int) h;
+    f = h - i;
+    p = v*(1-s);
+    q = v*(1-(s*f));
+    t = v*(1-s*(1-f));
+    switch(i) {
+      case 0:
+        r = v;
+        g = t;
+        b = p;
+        break;
+      case 1:
+        r = q;
+        g = v;
+        b = p;
+        break;
+      case 2:
+        r = p;
+        g = v;
+        b = t;
+        break;
+      case 3:
+        r = p;
+        g = q;
+        b = v;
+        break;
+      case 4:
+        r = t;
+        g = p;
+        b = v;
+        break;
+      case 5:
+        r = v;
+        g = p;
+        b = q;
+        break;
+      default:
+        r = 1.0;
+        g = 1.0;
+        b = 1.0;
+      //printf("hsv2rgb::How did I get here?\n");
+      // printf("h: %f, s: %f, v: %f; i:  %d\n",hin,s,v,i);
+        break;
+    }
+  }
+  return Vector(r,g,b);
+}
Index: /orxonox/trunk/src/lib/util/color.h
===================================================================
--- /orxonox/trunk/src/lib/util/color.h	(revision 5010)
+++ /orxonox/trunk/src/lib/util/color.h	(revision 5010)
@@ -0,0 +1,25 @@
+/*!
+ * @file color.h
+ * @brief Definition of color-calculations
+ *
+ * code borrowed from:
+ * http://www.easyrgb.com/math.php
+*/
+
+#ifndef _COLOR_H
+#define _COLOR_H
+
+//#include "vector.h"
+class Vector;
+
+class Color
+{
+  public:
+  static Vector RGBtoHSV (const Vector& RGB);
+  static Vector HSVtoRGB (const Vector& HSV);
+
+  static float minrgb(float r, float g, float b);
+  static float maxrgb(float r, float g, float b);
+};
+
+#endif /* _COLOR_H */
Index: xonox/trunk/src/util/color.cc
===================================================================
--- /orxonox/trunk/src/util/color.cc	(revision 5009)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-
-   this code has been borrowed from:
-   http://www.easyrgb.com/math.php
-*/
-
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
-
-#include "color.h"
-
-using namespace std;
-
-Vector Color::RGBtoHSV (Vector RGB)
-{
-  Vector HSV;
-
-  float var_Min = min( RGB.x, RGB.y, RGB.z );    //Min. value of RGB
-  float var_Max = max( RGB.x, RGB.y, RGB.z );    //Max. value of RGB
-  float del_Max = var_Max - var_Min;             //Delta RGB value
-
-  flaot V = var_Max;
-
-  if ( del_Max == 0 )                     //This is a gray, no chroma...
-  {
-    HSV.x = 0                                //HSV results = 0 ÷ 1
-    HSV.y = 0
-  }
-  else                                    //Chromatic data...
-  {
-    HSV.y = del_Max / var_Max;
-
-    float del_R = ( ( ( var_Max - RGB.x ) / 6 ) + ( del_Max / 2 ) ) / del_Max;
-    float del_G = ( ( ( var_Max - RGB.y ) / 6 ) + ( del_Max / 2 ) ) / del_Max;
-    float del_B = ( ( ( var_Max - RGB.z ) / 6 ) + ( del_Max / 2 ) ) / del_Max;
-
-    if ( RGB.x == var_Max )
-      HSV.x = del_B - del_G;
-    else if ( var_G == var_Max )
-      HSV.x = ( 1 / 3 ) + del_R - del_B;
-    else if ( var_B == var_Max )
-      HSV.z = ( 2 / 3 ) + del_G - del_R;
-
-    if ( HSV.x < 0 ) ; HSV.x += 1;
-    if ( HSV.x > 1 ) ; HSV.x -= 1;
-  }
-  return HSV;
-}
-
-
-Vector Color::HSVtoRGB (Vector HSV)
-{
-
-}
Index: xonox/trunk/src/util/color.h
===================================================================
--- /orxonox/trunk/src/util/color.h	(revision 5009)
+++ 	(revision )
@@ -1,21 +1,0 @@
-/*!
- * @file color.h
- * @brief Definition of color-calculations
- *
- * code borrowed from:
- * http://www.easyrgb.com/math.php
-*/
-
-#ifndef _COLOR_H
-#define _COLOR_H
-
-//#include "vector.h"
-class Vector;
-
-class Color
-{
-  Vector RGBtoHSV (Vector RGB);
-  Vector HSVtoRGB (Vector HSV);
-};
-
-#endif /* _COLOR_H */
Index: /orxonox/trunk/src/world_entities/camera.cc
===================================================================
--- /orxonox/trunk/src/world_entities/camera.cc	(revision 5009)
+++ /orxonox/trunk/src/world_entities/camera.cc	(revision 5010)
@@ -192,5 +192,5 @@
 void Camera::apply ()
 {
-  this->target->getParent()->debugDraw(0, 2);
+  this->target->getParent()->debugDraw(0, 2, Vector(1,0,0));
   // switching to Projection Matrix
   glMatrixMode (GL_PROJECTION);
