Index: code/branches/hud2/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/hud2/src/orxonox/CMakeLists.txt	(revision 1253)
+++ code/branches/hud2/src/orxonox/CMakeLists.txt	(revision 1254)
@@ -6,4 +6,5 @@
   hud/HUD.cc
   hud/BarOverlayElement.cc
+  hud/RadarOverlayElement.cc
   particle/ParticleInterface.cc
   tools/BillboardSet.cc
Index: code/branches/hud2/src/orxonox/OrxonoxPlatform.h
===================================================================
--- code/branches/hud2/src/orxonox/OrxonoxPlatform.h	(revision 1253)
+++ code/branches/hud2/src/orxonox/OrxonoxPlatform.h	(revision 1254)
@@ -175,5 +175,5 @@
 //For apple, we always have a custom config.h file
 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
-#  include "config.h"
+//#  include "config.h"
 #endif
 
Index: code/branches/hud2/src/orxonox/hud/BarOverlayElement.h
===================================================================
--- code/branches/hud2/src/orxonox/hud/BarOverlayElement.h	(revision 1253)
+++ code/branches/hud2/src/orxonox/hud/BarOverlayElement.h	(revision 1254)
@@ -44,4 +44,5 @@
   {
   private:
+    
     int percentage_;
     int dir_;	
@@ -50,7 +51,7 @@
     int width_;
     int height_;
-	
+
     static Ogre::String& typeName_s;
-	
+
   public:
 
@@ -75,5 +76,5 @@
 
   };
-  
+
   
   class _OrxonoxExport SmartBarOverlayElement : public BarOverlayElement
@@ -89,7 +90,6 @@
       void initSmartBarOverlayElement(Ogre::Real left, Ogre::Real top, Ogre::Real width, Ogre::Real height, int dir);
       void reset(int percentage);
+      
   };
-
-  
 }
 
Index: code/branches/hud2/src/orxonox/hud/HUD.cc
===================================================================
--- code/branches/hud2/src/orxonox/hud/HUD.cc	(revision 1253)
+++ code/branches/hud2/src/orxonox/hud/HUD.cc	(revision 1254)
@@ -33,7 +33,9 @@
 #include <OgreSceneNode.h>
 #include <OgreEntity.h>
+#include "core/Debug.h"
 
 #include "HUD.h"
 #include "BarOverlayElement.h"
+#include "RadarOverlayElement.h"
 #include "OverlayElementFactories.h"
 // ugly hack
@@ -55,4 +57,7 @@
     overlayManager.addOverlayElementFactory(smartBarOverlayElementFactory);
     
+    RadarOverlayElementFactory *radarOverlayElementFactory = new RadarOverlayElementFactory();
+    overlayManager.addOverlayElementFactory(radarOverlayElementFactory);
+    
     Ogre::Overlay* orxonoxOverlay = overlayManager.create("Orxonox/HUD"); 
 
@@ -62,10 +67,59 @@
     energyCounter->show();
     
+    
+    radar = static_cast<RadarOverlayElement*>(overlayManager.createOverlayElement("Radar", "radar"));
+    radar->show();
+
+    
+/*    TextAreaOverlayElement* test = static_cast<TextAreaOverlayElement*>(overlayManager.createOverlayElement("TextArea", "test"));
+    
+    int dirX, dirY, dirZ;      //flying direction
+    int ortX, ortY, ortZ;      //orthogonal direction
+    int dX, dY, dZ;            //distance between main ship and the object
+    int vecX, vecY, vecZ;      //vector product dir X ort
+    double alpha;              //defines the radius in the radar
+    double beta;               //defines the angle in the radar
+    bool right;                //checks whether the object is on the right side (since cos is not bijective)
+    
+    dirX = 1;
+    dirY = 0;
+    dirZ = 0;
+    
+    ortX = 0;
+    ortY = 0;
+    ortZ = 1;
+    
+    dX = -2;
+    dY = 2;
+    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;
+    
+    test->setCaption("hell");
+    test->setPosition(10,10);
+    test->setDimensions(20,20);
+    test->show();
+    test->setMetricsMode(Ogre::GMM_PIXELS);	
+    energyCounterPanel->addChild(test);
+    
+    COUT(0)<<alpha<<" "<<beta<<" "<<right<<std::endl;
+*/
+    
     energyCounterPanel->addChild(energyCounter);
+    energyCounterPanel->addChild(radar);
     energyCounterPanel->show();
-
+    
     orxonoxOverlay->add2D(energyCounterPanel);
     orxonoxOverlay->show();
 
+    
+    
     // important: don't use SceneManager to create the node! but register the creator scene manager.
 /*    ogreNode_ = new Ogre::SceneNode(Orxonox::getSingleton()->getSceneManager(), "hudNoedely");
@@ -88,4 +142,6 @@
     energyCounter->initSmartBarOverlayElement(-100,0,200,20,BarOverlayElement::LEFT);
     energyCounter->reset(80);
+    
+    radar->initRadarOverlayElement(10,10,200,energyCounterPanel);
 
     
Index: code/branches/hud2/src/orxonox/hud/HUD.h
===================================================================
--- code/branches/hud2/src/orxonox/hud/HUD.h	(revision 1253)
+++ code/branches/hud2/src/orxonox/hud/HUD.h	(revision 1254)
@@ -39,4 +39,5 @@
 #include "core/Tickable.h"
 #include "BarOverlayElement.h"
+#include "RadarOverlayElement.h"
 
 
@@ -54,8 +55,9 @@
 
     SmartBarOverlayElement* energyCounter;
+    
+    RadarOverlayElement* radar;
 //    Ogre::SceneNode* ogreNode_;
   };
 }	
 
-
 #endif
Index: code/branches/hud2/src/orxonox/hud/OverlayElementFactories.h
===================================================================
--- code/branches/hud2/src/orxonox/hud/OverlayElementFactories.h	(revision 1253)
+++ code/branches/hud2/src/orxonox/hud/OverlayElementFactories.h	(revision 1254)
@@ -40,5 +40,5 @@
 
   class _OrxonoxExport BarOverlayElementFactory : public Ogre::OverlayElementFactory{
-  public:
+    public:
     Ogre::OverlayElement* createOverlayElement(const Ogre::String& instanceName){
       return new BarOverlayElement(instanceName);
@@ -53,13 +53,23 @@
   class _OrxonoxExport SmartBarOverlayElementFactory : public Ogre::OverlayElementFactory{
     public:
+    Ogre::OverlayElement* createOverlayElement(const Ogre::String& instanceName){
+      return new SmartBarOverlayElement(instanceName);
+    }
+    const Ogre::String& getTypeName(void) const{
+      static Ogre::String name = "SmartBar";
+      return name;
+    }
+  };
+
+  class _OrxonoxExport RadarOverlayElementFactory : public Ogre::OverlayElementFactory{
+    public:
       Ogre::OverlayElement* createOverlayElement(const Ogre::String& instanceName){
-	return new SmartBarOverlayElement(instanceName);
+	return new RadarOverlayElement(instanceName);
       }
       const Ogre::String& getTypeName(void) const{
-	static Ogre::String name = "SmartBar";
+	static Ogre::String name = "Radar";
 	return name;
       }
   };
-
 }
 
Index: code/branches/hud2/src/orxonox/hud/RadarOverlayElement.cc
===================================================================
--- code/branches/hud2/src/orxonox/hud/RadarOverlayElement.cc	(revision 1253)
+++ code/branches/hud2/src/orxonox/hud/RadarOverlayElement.cc	(revision 1254)
@@ -28,4 +28,6 @@
 #include <OgreOverlayManager.h>
 #include <OgreOverlayElement.h>
+#include <OgrePanelOverlayElement.h>
+
 #include <OgreStringConverter.h>
 #include <math.h>
@@ -47,5 +49,6 @@
   }
   
-  void RadarOverlayElement::initRadarOverlayElement(){
+  void RadarOverlayElement::initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container){
+    
     int dirX, dirY, dirZ;      //flying direction
     int ortX, ortY, ortZ;      //orthogonal direction
@@ -68,6 +71,6 @@
     dZ = 0;
     
-    alpha = acos(((double)(dirX*dX+dirY*dY+dirZ*dZ))/(sqrt((double)(pow(dX,2)+pow(dY,2)+pow(dZ,2)))+sqrt((double)(pow(dirX,2)+pow(dirY,2)+pow(dirZ,2)))));
-    beta = acos(((double)(ortX*dX+ortY*dY+ortZ*dZ))/(sqrt((double)(pow(dX,2)+pow(dY,2)+pow(dZ,2)))+sqrt((double)(pow(ortX,2)+pow(ortY,2)+pow(ortZ,2)))));
+    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;
@@ -76,7 +79,37 @@
     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/MapBackGround");
+    
+    Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
 
+    PanelOverlayElement* point = static_cast<PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "point"));
+    point->show();
+    
+    container->addChild(point);
+    
+    if (right){
+      point->setPosition(sin(beta)*alpha/3.14*dim/2+dim/2,-cos(beta)*alpha/3.14*dim/2+dim/2);
+      point->setMaterialName("Orxonox/Red");
+      point->setDimensions(5,5);
+      point->setMetricsMode(Ogre::GMM_PIXELS);
+    }
+  
+    else {
+      point->setPosition(-sin(beta)*alpha/3.14*dim/2+dim/2,-cos(beta)*alpha/3.14*dim/2+dim/2);
+      point->setMaterialName("Orxonox/Red");
+      point->setDimensions(5,5);
+      point->setMetricsMode(Ogre::GMM_PIXELS);
+    }
 
+    
+
+    
+  }  
 }
 
 
+
Index: code/branches/hud2/src/orxonox/hud/RadarOverlayElement.h
===================================================================
--- code/branches/hud2/src/orxonox/hud/RadarOverlayElement.h	(revision 1253)
+++ code/branches/hud2/src/orxonox/hud/RadarOverlayElement.h	(revision 1254)
@@ -32,4 +32,6 @@
 #include <string.h>
 #include <OgreOverlayElement.h>
+#include <OgrePanelOverlayElement.h>
+
 #include <OgrePrerequisites.h>
 #include "../OrxonoxPrereqs.h"
@@ -50,5 +52,5 @@
     virtual void initialise();
 
-
+    void initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container);
   };
 }	
