Index: code/branches/hud3/bin/levels/sample.oxw
===================================================================
--- code/branches/hud3/bin/levels/sample.oxw	(revision 1307)
+++ code/branches/hud3/bin/levels/sample.oxw	(revision 1308)
@@ -1,3 +1,4 @@
- <!--audio>
+<!--
+<audio>
 	<ambient>
 		<ogg src="allgorythm-lift_up" />
@@ -7,9 +8,10 @@
 		<ogg src="tha_silent_partner_-_void" />
 	</ambient>
-  </audio--> 
+</audio>
+--> 
 
 <!--Ambient colourvalue="1,1,1" /-->
 <Skybox src="Orxonox/StarSkyBox" />
-<SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="-90,-90,0" mesh="assff.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
+<SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="0,0,0" mesh="assff.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
 
 <NPC position="0,100,400" scale="1" mesh="razor.mesh"/>
Index: code/branches/hud3/src/orxonox/hud/HUD.h
===================================================================
--- code/branches/hud3/src/orxonox/hud/HUD.h	(revision 1307)
+++ code/branches/hud3/src/orxonox/hud/HUD.h	(revision 1308)
@@ -44,5 +44,5 @@
 namespace orxonox
 {
-  class _OrxonoxExport HUD : Tickable
+  class _OrxonoxExport HUD : public Tickable
   {
   private:
Index: code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc
===================================================================
--- code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc	(revision 1307)
+++ code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc	(revision 1308)
@@ -60,23 +60,14 @@
         left_ = left;
         top_ = top;
-        count_ = 0;
+        count_ = 100;
         container_ = container;
 
         shipPos_ = Vector3(0.0, 0.0, 0.0);
-        targetPos_ = Vector3(42.0, 42.0, 0.0);
-        initialDir_ = Vector3(0.0, 0.0, 1.0);
+        targetPos_ = Vector3(42.0, 0.0, 0.0);
+        initialDir_ = Vector3(1.0, 0.0, 0.0);
         currentDir_ = initialDir_;
-        initialOrth_ = Vector3(0.0, 1.0, 0.0);
+        initialOrth_ = Vector3(0.0, 0.0, 1.0);
         currentOrth_ = initialOrth_;
-
-        alpha_ = acos((currentDir_.dotProduct(targetPos_ - shipPos_))/((targetPos_ - shipPos_).length()*currentDir_.length()));
-        beta_ = acos((currentOrth_.dotProduct(targetPos_ - shipPos_))/((targetPos_ - shipPos_).length()*currentOrth_.length()));
-        vec_ = currentDir_.crossProduct(currentOrth_);
-
-        if(vec_.dotProduct(targetPos_ - shipPos_) > 0)
-            right_ = true;
-        else
-            right_=false;
-
+     
         setMetricsMode(Ogre::GMM_PIXELS);
         setPosition(left,top);
@@ -88,18 +79,8 @@
         point->show();
         container->addChild(point);
+        point->setMaterialName("Orxonox/RedPoint");
+        point->setDimensions(5,5);
+        point->setMetricsMode(Ogre::GMM_PIXELS);
 
-        if (right_){
-            point->setPosition(sin(beta_)*alpha_/3.5*dim_/2+dim_/2+left-2,-cos(beta_)*alpha_/3.5*dim_/2+dim_/2+top-2);
-            point->setMaterialName("Orxonox/RedPoint");
-            point->setDimensions(5,5);
-            point->setMetricsMode(Ogre::GMM_PIXELS);
-        }
-
-        else {
-            point->setPosition(-sin(beta_)*alpha_/3.5*dim_/2+dim_/2+left-2,-cos(beta_)*alpha_/3.5*dim_/2+dim_/2+top-2);
-            point->setMaterialName("Orxonox/RedPoint");
-            point->setDimensions(5,5);
-            point->setMetricsMode(Ogre::GMM_PIXELS);
-        }
     }
 
@@ -114,6 +95,26 @@
 
     void RadarOverlayElement::update() {
+    	if(count_++ >= 100) {		// for testing purposes
+			count_ = 0;
+			COUT(3) << "pos:  " << shipPos_ << std::endl;
+			COUT(3) << "dir:  " << currentDir_ << std::endl;
+			COUT(3) << "orth: " << currentOrth_ << std::endl << std::endl;     	
+    	}
         shipPos_ = SpaceShip::instance_s->getPosition();
-        currentDir_ = SpaceShip::instance_s->getOrientation()*initialDir_; // according to beni....
+        currentDir_ = SpaceShip::instance_s->getOrientation()*initialDir_; 		// according to beni....
+		currentOrth_ = SpaceShip::instance_s->getOrientation()*initialOrth_;
+		
+		radius_ = acos((currentDir_.dotProduct(targetPos_ - shipPos_))/((targetPos_ - shipPos_).length()*currentDir_.length()));
+        phi_ = acos((currentOrth_.dotProduct(targetPos_ - shipPos_))/((targetPos_ - shipPos_).length()*currentOrth_.length()));
+        vec_ = currentDir_.crossProduct(currentOrth_);
+        if(vec_.dotProduct(targetPos_ - shipPos_) > 0) right_ = true;
+        else right_=false;
+        
+        if (right_){
+            point->setPosition(sin(phi_)*radius_/3.5*dim_/2+dim_/2+left_-2,-cos(phi_)*radius_/3.5*dim_/2+dim_/2+top_-2);         
+        }
+        else {
+            point->setPosition(-sin(phi_)*radius_/3.5*dim_/2+dim_/2+left_-2,-cos(phi_)*radius_/3.5*dim_/2+dim_/2+top_-2);
+        }
     }
 
Index: code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc~
===================================================================
--- code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc~	(revision 1307)
+++ code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc~	(revision 1308)
@@ -26,5 +26,5 @@
 */
 
-/*	local coordinate system of space ship:
+/*	local coordinate system of space ship at the beginning:
 
 			y
@@ -33,5 +33,5 @@
 			| /
 			|/
-	       x +------O
+   x +------O
 */
 
@@ -42,80 +42,81 @@
 #include "RadarOverlayElement.h"
 
-
 namespace orxonox
 {
-  using namespace Ogre;
+    using namespace Ogre;
 
-  RadarOverlayElement::RadarOverlayElement(const String& name):Ogre::PanelOverlayElement(name){
-    initialDir = Vector3(0.0, 0.0, 1.0);
-  }
+    RadarOverlayElement::RadarOverlayElement(const String& name):Ogre::PanelOverlayElement(name){
+    }
 
-  RadarOverlayElement::~RadarOverlayElement(){}
+    RadarOverlayElement::~RadarOverlayElement(){
+    }
 
-  void RadarOverlayElement::initialise(){
-    PanelOverlayElement::initialise();
-  }
-  
-  void RadarOverlayElement::initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container){
+    void RadarOverlayElement::initialise(){
+        PanelOverlayElement::initialise();
+    }
 
-    dirX_ = 0;	// direction of travel
-    dirY_ = 0;
-    dirZ_ = 1;
-    
-    ortX_ = 0;	// normal of ship
-    ortY_ = 1;
-    ortZ_ = 0;
-    
-    dX_ = 37;
-    dY_ = 0;
-    dZ_ = 0;
-    
-    alpha_ = acos((dirX_*dX_+dirY_*dY_+dirZ_*dZ_)/(sqrt(pow(dX_,2)+pow(dY_,2)+pow(dZ_,2))*sqrt(pow(dirX_,2)+pow(dirY_,2)+pow(dirZ_,2))));
-    beta_ = acos((ortX_*dX_+ortY_*dY_+ortZ_*dZ_)/(sqrt(pow(dX_,2)+pow(dY_,2)+pow(dZ_,2))*sqrt(pow(ortX_,2)+pow(ortY_,2)+pow(ortZ_,2))));
-    vecX_ = dirY_*ortZ_ - dirZ_*ortY_;
-    vecY_ = dirZ_*ortX_ - dirX_*ortZ_;
-    vecZ_ = dirX_*ortY_ - dirY_*ortX_;
-    
-    if((vecX_*dX_+vecY_*dY_+vecZ_*dZ_)>0){right_=true;}
-    else right_=false;
-    
-    setMetricsMode(Ogre::GMM_PIXELS);
-    setPosition(left,top);
-    setDimensions(dim,dim);
-    setMaterialName("Orxonox/Radar");
-    
-    Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
+    void RadarOverlayElement::initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container){
+        dim_ = dim;
+        left_ = left;
+        top_ = top;
+        count_ = 100;
+        container_ = container;
 
-    PanelOverlayElement* point = static_cast<PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "point"));
-    point->show();
-    
-    container->addChild(point);
-    
-    if (right_){
-      point->setPosition(sin(beta_)*alpha_/3.5*dim/2+dim/2+left-2,-cos(beta_)*alpha_/3.5*dim/2+dim/2+top-2);
-      point->setMaterialName("Orxonox/RedPoint");
-      point->setDimensions(5,5);
-      point->setMetricsMode(Ogre::GMM_PIXELS);
+        shipPos_ = Vector3(0.0, 0.0, 0.0);
+        targetPos_ = Vector3(42.0, 0.0, 0.0);
+        initialDir_ = Vector3(1.0, 0.0, 0.0);
+        currentDir_ = initialDir_;
+        initialOrth_ = Vector3(0.0, 0.0, 1.0);
+        currentOrth_ = initialOrth_;
+     
+        setMetricsMode(Ogre::GMM_PIXELS);
+        setPosition(left,top);
+        setDimensions(dim_,dim_);
+        setMaterialName("Orxonox/Radar");
+
+        om = &Ogre::OverlayManager::getSingleton();
+        point = static_cast<PanelOverlayElement*>(om->createOverlayElement("Panel", "point"));
+        point->show();
+        container->addChild(point);
+        point->setMaterialName("Orxonox/RedPoint");
+        point->setDimensions(5,5);
+        point->setMetricsMode(Ogre::GMM_PIXELS);
+
     }
-  
-    else {
-      point->setPosition(-sin(beta_)*alpha_/3.5*dim/2+dim/2+left-2,-cos(beta_)*alpha_/3.5*dim/2+dim/2+top-2);
-      point->setMaterialName("Orxonox/RedPoint");
-      point->setDimensions(5,5);
-      point->setMetricsMode(Ogre::GMM_PIXELS);
+
+//    void RadarOverlayElement::setMainShipPosition(int dirX, int dirY, int dirZ, int ortX, int ortY, int ortZ){
+//        dirX_=dirX;
+//        dirY_=dirY;
+//        dirZ_=dirZ;
+//        ortX_=ortX;
+//        ortY_=ortY;
+//        ortZ_=ortZ;
+//    }
+
+    void RadarOverlayElement::update() {
+    	if(count_++ >= 100) {		// for testing purposes
+			count_ = 0;
+			COUT(3) << "pos:  " << shipPos_ << std::endl;
+			COUT(3) << "dir:  " << currentDir_ << std::endl;
+			COUT(3) << "orth: " << currentOrth_ << std::endl << std::endl;     	
+    	}
+        shipPos_ = SpaceShip::instance_s->getPosition();
+        currentDir_ = SpaceShip::instance_s->getOrientation()*initialDir_; 		// according to beni....
+		currentOrth_ = SpaceShip::instance_s->getOrientation()*initialOrth_;
+		
+		radius_ = acos((currentDir_.dotProduct(targetPos_ - shipPos_))/((targetPos_ - shipPos_).length()*currentDir_.length()));
+        phi_ = acos((currentOrth_.dotProduct(targetPos_ - shipPos_))/((targetPos_ - shipPos_).length()*currentOrth_.length()));
+        vec_ = currentDir_.crossProduct(currentOrth_);
+        if(vec_.dotProduct(targetPos_ - shipPos_) > 0) right_ = true;
+        else right_=false;
+        
+        if (right_){
+            point->setPosition(sin(phi_)*radius_/3.5*dim_/2+dim_/2+left_-2,-cos(phi_)*radius_/3.5*dim_/2+dim_/2+top_-2);         
+        }
+        else {
+            point->setPosition(-sin(phi_)*radius_/3.5*dim_/2+dim_/2+left_-2,-cos(phi_)*radius_/3.5*dim_/2+dim_/2+top_-2);
+        }
     }
-  } 
-   
-  void RadarOverlayElement::setMainShipPosition(int dirX, int dirY, int dirZ, int ortX, int ortY, int ortZ){
-    dirX_=dirX;
-    dirY_=dirY;
-    dirZ_=dirZ;
-    ortX_=ortX;
-    ortY_=ortY;
-    ortZ_=ortZ;
-  }
-  
-  
-  
+
 }
 
Index: code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h
===================================================================
--- code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h	(revision 1307)
+++ code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h	(revision 1308)
@@ -56,6 +56,6 @@
     Vector3 shipPos_;               //position of ship
     Vector3 vec_;                   //vector product dir X ort
-    double alpha_;                  //defines the radius in the radar
-    double beta_;                   //defines the angle in the radar
+    double radius_;                  //defines the radius in the radar
+    double phi_;                   //defines the angle in the radar
     float left_, top_;
     bool right_;                    //checks whether the object is on the right side (since cos is not bijective)
Index: code/branches/hud3/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/branches/hud3/src/orxonox/objects/SpaceShip.cc	(revision 1307)
+++ code/branches/hud3/src/orxonox/objects/SpaceShip.cc	(revision 1308)
@@ -432,7 +432,7 @@
 
     std::string SpaceShip::whereAmI() {
-	return getConvertedValue<int, std::string>(SpaceShip::instance_s->getPosition().x)
-	+ "  " + getConvertedValue<int, std::string>(SpaceShip::instance_s->getPosition().y)
-	+ "  " + getConvertedValue<int, std::string>(SpaceShip::instance_s->getPosition().z);
+	return getConvertedValue<float, std::string>(SpaceShip::instance_s->getPosition().x)
+	+ "  " + getConvertedValue<float, std::string>(SpaceShip::instance_s->getPosition().y)
+	+ "  " + getConvertedValue<float, std::string>(SpaceShip::instance_s->getPosition().z);
     }
 
