Index: code/branches/hud3/src/orxonox/hud/BarOverlayElement.cc
===================================================================
--- code/branches/hud3/src/orxonox/hud/BarOverlayElement.cc	(revision 1311)
+++ code/branches/hud3/src/orxonox/hud/BarOverlayElement.cc	(revision 1314)
@@ -29,6 +29,5 @@
 #include <OgreOverlayElement.h>
 #include <OgrePanelOverlayElement.h>
-
-
+#include "GraphicsEngine.h"
 #include "BarOverlayElement.h"
 
@@ -51,50 +50,58 @@
 
 
-    void BarOverlayElement::initBarOverlayElement(Real left, Real top, Real width, Real height,
-       int dir,  int colour){
-	 setMetricsMode(Ogre::GMM_PIXELS);
-	 dir_ = dir;
-	 left_ = left;
-	 top_ = top;
-	 width_ = width;
-	 height_ = height;
-	 setPosition(left_,top_);
-	 setDimensions(width_,height_);
-	 setColour(colour);
+    void BarOverlayElement::initBarOverlayElement(Real leftRel, Real topRel, Real widthRel, Real heightRel, int dir,  int colour){
+        windowW_ = GraphicsEngine::getSingleton().getWindowWidth();
+        windowH_ = GraphicsEngine::getSingleton().getWindowHeight();
+
+        dir_ = dir;
+        leftRel_ = leftRel;
+        topRel_ = topRel;
+        widthRel_ = widthRel;
+        heightRel_ = heightRel;
+
+        left_ = leftRel_ * windowW_;
+        top_ = topRel_ * windowH_;
+        width_ = widthRel_ * windowW_;
+        height_ = heightRel_ * windowH_;
+
+        setMetricsMode(Ogre::GMM_PIXELS);
+        setPosition(left_,top_);
+        setDimensions(width_,height_);
+        setColour(colour);
     }
 
 
    void BarOverlayElement::reset(int percentage){
-      switch(dir_){
+        switch(dir_){
         case 1:
-	  setPosition(left_,top_);
-	  setDimensions(width_,height_*percentage/100);
-	  break;
-	case 2:
-	  setPosition(left_+width_-width_*percentage/100,top_);
-	  setDimensions(width_*percentage/100,height_);
-	  break;
-	case 3:
-	  setPosition(left_,top_+height_-height_*percentage/100);
-	  setDimensions(width_,height_*percentage/100);
-	  break;
-	default:
-	  setPosition(left_,top_);
-	  setDimensions(width_*percentage/100,height_);	
-      }
+            setPosition(left_,top_);
+            setDimensions(width_,height_*percentage/100);
+            break;
+        case 2:
+            setPosition(left_+width_-width_*percentage/100,top_);
+            setDimensions(width_*percentage/100,height_);
+            break;
+        case 3:
+            setPosition(left_,top_+height_-height_*percentage/100);
+            setDimensions(width_,height_*percentage/100);
+            break;
+        default:
+            setPosition(left_,top_);
+            setDimensions(width_*percentage/100,height_);
+        }
     }
-       
-       
+
+
     void BarOverlayElement::setColour(int colour){
-      switch(colour){
-	case 0:
-	  setMaterialName("Orxonox/Red");
-	  break;
-	case 1:
-	  setMaterialName("Orxonox/Yellow");
-	  break;
-	case 2:
-	  setMaterialName("Orxonox/Green");
-      }
+        switch(colour){
+        case 0:
+            setMaterialName("Orxonox/Red");
+            break;
+        case 1:
+            setMaterialName("Orxonox/Yellow");
+            break;
+        case 2:
+            setMaterialName("Orxonox/Green");
+        }
     }
 
@@ -103,6 +110,6 @@
 
     SmartBarOverlayElement::~SmartBarOverlayElement(void){}
-    
-    
+
+
     void SmartBarOverlayElement::initialise(){
       PanelOverlayElement::initialise();
@@ -112,5 +119,5 @@
       setMetricsMode(Ogre::GMM_PIXELS);
 */  }
-    
+
     void SmartBarOverlayElement::initSmartBarOverlayElement(Real left, Real top, Real width, Real height, int dir)
     {
Index: code/branches/hud3/src/orxonox/hud/BarOverlayElement.h
===================================================================
--- code/branches/hud3/src/orxonox/hud/BarOverlayElement.h	(revision 1311)
+++ code/branches/hud3/src/orxonox/hud/BarOverlayElement.h	(revision 1314)
@@ -44,11 +44,16 @@
   {
   private:
-    
+
     int percentage_;
-    int dir_;	
+    int dir_;
     int left_;
     int top_;
     int width_;
     int height_;
+    Ogre::Real leftRel_;
+    Ogre::Real topRel_;
+    Ogre::Real widthRel_;
+    Ogre::Real heightRel_;
+    int windowW_, windowH_;
 
     static Ogre::String& typeName_s;
@@ -69,5 +74,5 @@
     virtual void initialise();
 
-    void initBarOverlayElement(Real left, Real top, Real width, Real height,
+    void initBarOverlayElement(Real leftRel, Real topRel, Real widthRel, Real heightRel,
           int dir,  int colour);
 
@@ -77,5 +82,5 @@
   };
 
-  
+
   class _OrxonoxExport SmartBarOverlayElement : public BarOverlayElement
   {
@@ -83,12 +88,12 @@
 
     public:
-      
+
       SmartBarOverlayElement(const Ogre::String& name);
       virtual ~SmartBarOverlayElement(void);
       virtual void initialise();
-      
+
       void initSmartBarOverlayElement(Ogre::Real left, Ogre::Real top, Ogre::Real width, Ogre::Real height, int dir);
       void reset(int percentage);
-      
+
   };
 }
Index: code/branches/hud3/src/orxonox/hud/HUD.cc
===================================================================
--- code/branches/hud3/src/orxonox/hud/HUD.cc	(revision 1311)
+++ code/branches/hud3/src/orxonox/hud/HUD.cc	(revision 1314)
@@ -48,25 +48,26 @@
 
   HUD::HUD(int zoom){
-
-    Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
+    om = &Ogre::OverlayManager::getSingleton();
 
     BarOverlayElementFactory *barOverlayElementFactory = new BarOverlayElementFactory();
-    overlayManager.addOverlayElementFactory(barOverlayElementFactory);
+    om->addOverlayElementFactory(barOverlayElementFactory);
 
     SmartBarOverlayElementFactory *smartBarOverlayElementFactory = new SmartBarOverlayElementFactory();
-    overlayManager.addOverlayElementFactory(smartBarOverlayElementFactory);
+    om->addOverlayElementFactory(smartBarOverlayElementFactory);
 
     RadarOverlayElementFactory *radarOverlayElementFactory = new RadarOverlayElementFactory();
-    overlayManager.addOverlayElementFactory(radarOverlayElementFactory);
+    om->addOverlayElementFactory(radarOverlayElementFactory);
 
-    Ogre::Overlay* orxonoxOverlay = overlayManager.create("Orxonox/HUD");
+    orxonoxHUD = om->create("Orxonox/HUD");
 
-    Ogre::OverlayContainer* energyCounterPanel = static_cast<Ogre::OverlayContainer*>(overlayManager.createOverlayElement("Panel", "Orxonox/HUD/energyCounterPanel"));
+    container = static_cast<Ogre::OverlayContainer*>(om->createOverlayElement("Panel", "Orxonox/HUD/container"));
 
-    energyCounter = static_cast<SmartBarOverlayElement*>(overlayManager.createOverlayElement("SmartBar", "energyCounter"));
-    //energyCounter->show();
+    energyCounter = static_cast<SmartBarOverlayElement*>(om->createOverlayElement("SmartBar", "energyCounter"));
+    energyCounter->show();
 
+    speedo = static_cast<SmartBarOverlayElement*>(om->createOverlayElement("SmartBar", "speedo"));
+    speedo->show();
 
-    radar = static_cast<RadarOverlayElement*>(overlayManager.createOverlayElement("Radar", "radar"));
+    radar = static_cast<RadarOverlayElement*>(om->createOverlayElement("Radar", "radar"));
     radar->show();
 
@@ -108,15 +109,16 @@
     test->show();
     test->setMetricsMode(Ogre::GMM_PIXELS);
-    energyCounterPanel->addChild(test);
+    container->addChild(test);
 
     COUT(0)<<alpha<<" "<<beta<<" "<<right<<std::endl;
 */
 
-    energyCounterPanel->addChild(energyCounter);
-    energyCounterPanel->addChild(radar);
-    energyCounterPanel->show();
+    container->addChild(energyCounter);
+    container->addChild(speedo);
+    container->addChild(radar);
+    container->show();
 
-    orxonoxOverlay->add2D(energyCounterPanel);
-    orxonoxOverlay->show();
+    orxonoxHUD->add2D(container);
+    orxonoxHUD->show();
 
 
@@ -133,14 +135,17 @@
 */
 
-    energyCounterPanel->setLeft(0.0);
-    energyCounterPanel->setTop(0.0);
-    energyCounterPanel->setWidth(1.0);
-    energyCounterPanel->setHeight(1.0);
-    energyCounterPanel->setMetricsMode(Ogre::GMM_RELATIVE);
+    container->setLeft(0.0);
+    container->setTop(0.0);
+    container->setWidth(1.0);
+    container->setHeight(1.0);
+    container->setMetricsMode(Ogre::GMM_RELATIVE);
 
-    energyCounter->initSmartBarOverlayElement(10,10,200,20,BarOverlayElement::LEFT);
-    energyCounter->reset(80);
+    energyCounter->initSmartBarOverlayElement(0.01, 0.01, 0.2, 0.02, BarOverlayElement::LEFT);
+    energyCounter->reset(100);
 
-    radar->initRadarOverlayElement(0.5, 0.8, 0.2, energyCounterPanel);
+    speedo->initSmartBarOverlayElement(0.01, 0.04, 0.2, 0.02, BarOverlayElement::LEFT);
+    speedo->reset(80);
+
+    radar->initRadarOverlayElement(0.5, 0.9, 0.2, container);
 
 
@@ -149,4 +154,8 @@
   void HUD::tick(float dt)
   {
+      float v = SpaceShip::instance_s->getVelocity().length();
+      float vmax = SpaceShip::instance_s->getMaxSpeed();
+      speedo->reset(100*v/vmax);
+      COUT(3) << 100*v/vmax << std::endl;
       radar->update();
     /*if (this->ogreNode_)
Index: code/branches/hud3/src/orxonox/hud/HUD.h
===================================================================
--- code/branches/hud3/src/orxonox/hud/HUD.h	(revision 1311)
+++ code/branches/hud3/src/orxonox/hud/HUD.h	(revision 1314)
@@ -36,5 +36,5 @@
 
 #include "OrxonoxPrereqs.h"
-
+#include "objects/SpaceShip.h"
 #include "core/Tickable.h"
 #include "BarOverlayElement.h"
@@ -44,18 +44,20 @@
 namespace orxonox
 {
-  class _OrxonoxExport HUD : public Tickable
-  {
-  private:
+    class _OrxonoxExport HUD : public Tickable
+    {
+        private:
+            Ogre::OverlayManager* om;
+            Ogre::Overlay* orxonoxHUD;
+            Ogre::OverlayContainer* container;
+            SmartBarOverlayElement* energyCounter;
+            SmartBarOverlayElement* speedo;
+            RadarOverlayElement* radar;
 
-  public:
-    HUD(int zoom);
-    ~HUD();
+        public:
+            HUD(int zoom);
+            ~HUD();
+            virtual void tick(float);
 
-    virtual void tick(float);
-
-    SmartBarOverlayElement* energyCounter;
-
-    RadarOverlayElement* radar;
-  };
+    };
 }
 
Index: code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc
===================================================================
--- code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc	(revision 1311)
+++ code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc	(revision 1314)
@@ -57,12 +57,9 @@
     }
 
-    void RadarOverlayElement::initRadarOverlayElement(Real left, Real top, Real dim, Ogre::OverlayContainer* container){
-
-        windowW = GraphicsEngine::getSingleton().getWindowWidth();
-        windowH = GraphicsEngine::getSingleton().getWindowHeight();
-        dim_ = dim*windowH;                         //convert relative data to absolute
-        left_ = left*windowW-dim_/2;                // ...
-        top_ = top*windowH-dim_/2;                  // ...
+    void RadarOverlayElement::initRadarOverlayElement(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container){
         count_ = 0;
+        dimRel_ = dimRel;
+        leftRel_ = leftRel;
+        topRel_ = topRel;
         container_ = container;
 
@@ -76,6 +73,5 @@
         setMetricsMode(Ogre::GMM_PIXELS);
         setMaterialName("Orxonox/Radar");
-        setPosition(left_, top_);
-        setDimensions(dim_,dim_);
+        resize();
 
         om = &Ogre::OverlayManager::getSingleton();
@@ -87,4 +83,15 @@
         point->setMetricsMode(Ogre::GMM_PIXELS);
 
+    }
+
+    void RadarOverlayElement::resize() {
+        // if window is resized, we must adapt these...
+        windowW_ = GraphicsEngine::getSingleton().getWindowWidth();
+        windowH_ = GraphicsEngine::getSingleton().getWindowHeight();
+        dim_ = dimRel_*windowH_;
+        left_ = leftRel_*windowW_-dim_/2;
+        top_ = topRel_*windowH_-dim_/2;
+        setPosition(left_, top_);
+        setDimensions(dim_,dim_);
     }
 
@@ -99,4 +106,5 @@
 
     void RadarOverlayElement::update() {
+        resize();
         shipPos_ = SpaceShip::instance_s->getPosition();
         currentDir_ = SpaceShip::instance_s->getOrientation()*initialDir_; 		// according to beni....
Index: code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h
===================================================================
--- code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h	(revision 1311)
+++ code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h	(revision 1314)
@@ -48,18 +48,21 @@
     Ogre::PanelOverlayElement* point;
     Ogre::OverlayContainer* container_;
-    Ogre::OverlayManager* om;       //pointer to the one and only overlay manager
-    Vector3 initialDir_;	        // direction of nose
+    Ogre::OverlayManager* om;               // pointer to the one and only overlay manager
+    Vector3 initialDir_;	                // direction of nose
     Vector3 currentDir_;
-    Vector3 initialOrth_;           // direction of normal
+    Vector3 initialOrth_;                   // direction of normal
     Vector3 currentOrth_;
-    Vector3 targetPos_;             //position of target
-    Vector3 shipPos_;               //position of ship
+    Vector3 targetPos_;                     // position of target
+    Vector3 shipPos_;                       // position of ship
 
-    double radius_;                 //defines the radius on the radar
-    double phi_;                    //defines the angle on the radar
-    float left_, top_, dim_;
-    bool right_;                    //checks whether the object is on the right side (since cos is not bijective)
+    Ogre::Real radius_;                     // radius on the radar
+    Ogre::Real phi_;                        // angle on the radar
+    bool right_;                            // checks whether the object is on the right side (since cos is not bijective)
+    Ogre::Real leftRel_, topRel_, dimRel_;  // relative position/dimension
+    int left_, top_, dim_;                  // absolute position/dimension
+    int windowW_, windowH_;                   // absolute window dimensions
     int count_;
-    int windowW, windowH;
+
+    void resize();
 
   public:
@@ -69,5 +72,5 @@
     virtual void initialise();
     void update();
-    void initRadarOverlayElement(Real left, Real top, Real dim, Ogre::OverlayContainer* container);
+    void initRadarOverlayElement(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container);
     void setMainShipPosition(int dirX, int dirY, int dirZ, int ortX, int ortY, int ortZ);
     int newShip(int X, int Y, int Z);
Index: code/branches/hud3/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/branches/hud3/src/orxonox/objects/SpaceShip.cc	(revision 1311)
+++ code/branches/hud3/src/orxonox/objects/SpaceShip.cc	(revision 1314)
@@ -270,7 +270,4 @@
       camName_=camera;
       // change camera attributes here, if you want to ;)
-      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
-      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,0,-1));
-      //camNode_->setOrientation(q1*q2);
     }
 
@@ -298,4 +295,7 @@
       cam_->setTargetNode(this->getNode());
 //        cam->setPosition(Vector3(0,-350,0));
+      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
+      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,0,-1));
+      //camNode_->setOrientation(q1*q2);
       if(network::Client::getSingleton()!=0 && network::Client::getSingleton()->getShipID()==objectID){
         this->setBacksync(true);
@@ -448,4 +448,6 @@
     }
 
+    float SpaceShip::getMaxSpeed() { return maxSpeed_; }
+
     void SpaceShip::tick(float dt)
     {
Index: code/branches/hud3/src/orxonox/objects/SpaceShip.h
===================================================================
--- code/branches/hud3/src/orxonox/objects/SpaceShip.h	(revision 1311)
+++ code/branches/hud3/src/orxonox/objects/SpaceShip.h	(revision 1314)
@@ -64,8 +64,8 @@
 
             void getFocus();
-	    static SpaceShip* instance_s;
-	    static Vector3 getSPosition();
-	    static Quaternion getSOrientation();
-	    static std::string whereAmI();
+            static SpaceShip* instance_s;
+            static Vector3 getSPosition();
+            static Quaternion getSOrientation();
+            static std::string whereAmI();
             static void setMaxSpeedTest(float value)
                 { SpaceShip::instance_s->setMaxSpeed(value); }
@@ -77,4 +77,5 @@
             bool mouseScrolled      (const MouseState& state) { return true; }
 
+            float getMaxSpeed();
 
         private:
