Index: code/branches/map/src/orxonox/objects/RadarViewable.cc
===================================================================
--- code/branches/map/src/orxonox/objects/RadarViewable.cc	(revision 2912)
+++ code/branches/map/src/orxonox/objects/RadarViewable.cc	(revision 2913)
@@ -45,4 +45,6 @@
         , radarObjectShape_(Dot)
         , radarObjectDescription_("staticObject")
+        , MapNode_(NULL)
+        , MapEntity_(NULL)
     {
         RegisterRootObject(RadarViewable);
Index: code/branches/map/src/orxonox/objects/RadarViewable.h
===================================================================
--- code/branches/map/src/orxonox/objects/RadarViewable.h	(revision 2912)
+++ code/branches/map/src/orxonox/objects/RadarViewable.h	(revision 2913)
@@ -36,4 +36,7 @@
 #include "util/Debug.h"
 #include "core/OrxonoxClass.h"
+
+#include <OgreSceneNode.h>
+#include <OgreEntity.h>
 
 namespace orxonox
@@ -80,4 +83,18 @@
             { return this->radarObjectShape_; }
 
+/*
+        inline void setMapNode(Ogre::SceneNode * node)
+            { this->MapNode_ = node; }
+        inline Ogre::SceneNode * getMapNode() const
+            { return this->MapNode_; }
+        inline void setMapEntity(Ogre::Entity * ent)
+            { this->MapEntity_ = ent; }
+        inline Ogre::Entity * getMapEntity() const
+            { return this->MapEntity_; }
+*/
+        //Used for Map
+        Ogre::SceneNode * MapNode_;
+        Ogre::Entity * MapEntity_;
+
     private:
         void validate(const WorldEntity* object) const
@@ -94,4 +111,5 @@
         std::string radarObjectDescription_;
         ColourValue radarObjectColour_;
+        
     };
 }
Index: code/branches/map/src/orxonox/objects/worldentities/CameraPosition.cc
===================================================================
--- code/branches/map/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2912)
+++ code/branches/map/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2913)
@@ -30,4 +30,6 @@
 #include "CameraPosition.h"
 
+#include <OgreCamera.h>
+
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -44,4 +46,5 @@
         this->bDrag_ = false;
         this->bAllowMouseLook_ = false;
+        this->bRenderCamera_ = false;
 
         this->setObjectMode(0x0);
@@ -58,4 +61,5 @@
         XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false);
         XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false);
+        XMLPortParam(CameraPosition, "rendercamera", setRenderCamera, getRenderCamera, xmlelement, mode).defaultValues(false);
     }
 
@@ -70,3 +74,8 @@
             camera->setDrag(true);
     }
+
+    void CameraPosition::attachCamera(Ogre::Camera* camera)
+    {
+        this->attachOgreObject(camera);
+    }
 }
Index: code/branches/map/src/orxonox/objects/worldentities/CameraPosition.h
===================================================================
--- code/branches/map/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2912)
+++ code/branches/map/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2913)
@@ -54,9 +54,16 @@
                 { return this->bAllowMouseLook_; }
 
+            inline void setRenderCamera(bool bRenderCamera)
+                { this->bRenderCamera_ = bRenderCamera; }
+            inline bool getRenderCamera() const
+                { return this->bRenderCamera_; }
+
             void attachCamera(Camera* camera);
+            void attachCamera(Ogre::Camera* camera);
 
         private:
             bool bDrag_;
             bool bAllowMouseLook_;
+            bool bRenderCamera_;
     };
 }
Index: code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2912)
+++ code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2913)
@@ -62,4 +62,5 @@
         this->hud_ = 0;
         this->camera_ = 0;
+        this->reverseCamera_ = 0;
         this->bDestroyWhenPlayerLeft_ = false;
         this->cameraPositionRootNode_ = this->node_->createChildSceneNode();
@@ -148,5 +149,9 @@
         else
             this->attach(position);
-        this->cameraPositions_.push_back(position);
+
+        if (!position->getRenderCamera())
+            this->cameraPositions_.push_back(position);
+        else
+            this->setReverseCamera(position);
     }
 
Index: code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.h
===================================================================
--- code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2912)
+++ code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2913)
@@ -109,4 +109,9 @@
             inline const std::string& getCameraPositionTemkplate() const
                 { return this->cameraPositionTemplate_; }
+
+            inline void setReverseCamera(CameraPosition* camera)
+                { this->reverseCamera_ = camera; }
+            inline CameraPosition* getReverseCamera() const
+                { return this->reverseCamera_; }
 
             using WorldEntity::setPosition;
@@ -188,4 +193,5 @@
             std::list<CameraPosition*> cameraPositions_;
             std::string cameraPositionTemplate_;
+            CameraPosition* reverseCamera_;
 
             const GametypeInfo* gtinfo_;
Index: code/branches/map/src/orxonox/overlays/map/Map.cc
===================================================================
--- code/branches/map/src/orxonox/overlays/map/Map.cc	(revision 2912)
+++ code/branches/map/src/orxonox/overlays/map/Map.cc	(revision 2913)
@@ -31,4 +31,17 @@
 #include <OgreSceneNode.h>
 #include <OgreEntity.h>
+#include <OgreNode.h>
+
+#include <OgreRenderWindow.h>
+#include <OgreRenderTexture.h>
+#include <OgreTexture.h>
+#include <OgreViewport.h>
+#include <OgreMaterial.h>
+#include <OgreMaterialManager.h>
+#include <OgreRoot.h>
+#include <OgreHardwarePixelBuffer.h>
+#include "objects/worldentities/ControllableEntity.h"
+#include "objects/worldentities/CameraPosition.h"
+
 #include <OgreOverlay.h>
 #include <OgreOverlayElement.h>
@@ -39,4 +52,5 @@
 #include "core/ConsoleCommand.h"
 #include "objects/Scene.h"
+#include "objects/RadarViewable.h"
  
  namespace orxonox
@@ -52,25 +66,149 @@
         ObjectList<Scene>::iterator it = ObjectList<Scene>::begin();
         this->sManager_ = it->getSceneManager();
-        
-        this->sNode_ = new Ogre::SceneNode(sManager_);
-        oManager_ = Ogre::OverlayManager::getSingletonPtr();
-        overlay_ = oManager_->create("Map");
+
+        this->mapSceneM_ = Ogre::Root::getSingletonPtr()->createSceneManager( Ogre::ST_GENERIC,"MapScene" );
+        rootNode_ = mapSceneM_->getRootSceneNode();
+        
+        //this->sNode_ = new Ogre::SceneNode(sManager_);
+        //oManager_ = Ogre::OverlayManager::getSingletonPtr();
+        //overlay_ = oManager_->create("Map");
         //overlay_ is member of OrxonoxOverlay
         
+        //Not Showing the map as default
+        //this->isVisible_=false;
+        //overlay_->hide();
+        
+
+        //TestEntity
+        //Ogre::Entity * ent = mapSceneM_->createEntity("ent", "drone.mesh");
+        
+        //rootNode_->attachObject( ent );
+        /*sNode_->setPosition(0,0,-50);
+        overlay_->add3D(sNode_);
+        */
+	
+        
+        
+
+        
+        // Alter the camera aspect ratio to match the viewport
+        //mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+        mReflectCam_ = mapSceneM_->createCamera("ReflectCam");
+        mReflectCam_->setPosition(200,170, -160);
+        mReflectCam_->lookAt(0,0,0);
+        mReflectCam_->setAspectRatio(1);
+
+        std::string camMat_id = "RttMat";
+        Ogre::MaterialPtr material = this->createRenderCamera(mReflectCam_, camMat_id);
+/*
+        Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual("RttTex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
+
+        Ogre::RenderTexture *renderTexture = rttTex->getBuffer()->getRenderTarget();
+
+        renderTexture->addViewport(mReflectCam_);
+        renderTexture->getViewport(0)->setClearEveryFrame(true);
+        renderTexture->getViewport(0)->setBackgroundColour(ColourValue::Black);
+        renderTexture->getViewport(0)->setOverlaysEnabled(false);
+
+        Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create("RttMat", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        Ogre::Technique *technique = material->createTechnique();
+        technique->createPass();
+        material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+        material->getTechnique(0)->getPass(0)->createTextureUnitState("RttTex");
+*/
+
+
+        // create overlay
+/*
+        Ogre::Overlay* pOverlay = Ogre::OverlayManager::getSingleton().create("Overlay1");
+        
+        // Create a panel with RenderToTexture texture
+        Ogre::OverlayContainer* m_pOverlayPanel = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel","OverlayPanelName%d"));
+        m_pOverlayPanel->setMetricsMode(Ogre::GMM_PIXELS);
+        m_pOverlayPanel->setPosition(10, 10);
+        m_pOverlayPanel->setDimensions(500, 300);
+        // Give overlay a texture
+        m_pOverlayPanel->setMaterialName(camMat_id); 
+        pOverlay->add2D(m_pOverlayPanel);
+        pOverlay->show();
+*/
+        overlay_ = Ogre::OverlayManager::getSingleton().create("MapOverlay");
+        Ogre::OverlayContainer* m_pOverlayPanel = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel","OverlayPanelName%d"));
+        m_pOverlayPanel->setMetricsMode(Ogre::GMM_PIXELS);
+        m_pOverlayPanel->setPosition(10, 10);
+        m_pOverlayPanel->setDimensions(500, 300);
+        // Give overlay a texture
+        m_pOverlayPanel->setMaterialName(camMat_id); 
+        overlay_->add2D(m_pOverlayPanel);
         //Not Showing the map as default
         this->isVisible_=false;
         overlay_->hide();
-        
-        //TestEntity
-        Ogre::Entity * ent = sManager_->createEntity("ent", "drone.mesh");
-        sNode_->attachObject( ent );
-        sNode_->setPosition(0,0,-50);
-        overlay_->add3D(sNode_);
-    }
-    
+
+    }
+    
+    Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, std::string matName)
+    {
+        Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual(matName+"_tex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
+
+        Ogre::RenderTexture *renderTexture = rttTex->getBuffer()->getRenderTarget();
+
+        renderTexture->addViewport(cam);
+        renderTexture->getViewport(0)->setClearEveryFrame(true);
+        renderTexture->getViewport(0)->setBackgroundColour(ColourValue::Black);
+        renderTexture->getViewport(0)->setOverlaysEnabled(false);
+
+        Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create(matName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        Ogre::Technique *technique = material->createTechnique();
+        technique->createPass();
+        material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+        material->getTechnique(0)->getPass(0)->createTextureUnitState(matName+"_tex");
+        return material;
+    }
+
+    void Map::updatePositions()
+    {
+//Ogre::Entity * ent;// = mapSceneM_->createEntity("ent1", "drone.mesh");
+       int i=0; 
+       for(ObjectList<orxonox::RadarViewable>::iterator it = ObjectList<orxonox::RadarViewable>::begin();
+            it!=ObjectList<orxonox::RadarViewable>::end();
+            it++)
+        {
+            i++;
+            //COUT(0) << "Radar_Position: " << it->getRVWorldPosition() << std::endl;
+            //Ogre::SceneNode node = it->getMapNode();
+            //Ogre::Entity ent = it->getMapEntity();
+            if( !(it->MapNode_) )
+            {
+                it->MapNode_ = rootNode_->createChildSceneNode( it->getRVWorldPosition() );
+                //it->MapNode_->translate( it->getRVOrientedVelocity(), Ogre::TS_WORLD );
+            }
+            it->MapNode_->setPosition( it->getRVWorldPosition() );
+            it->MapNode_->translate( it->getRVOrientedVelocity(), (Ogre::Node::TransformSpace)3 );
+            if( !(it->MapEntity_) )
+            {
+                it->MapEntity_ = mapSceneM_->createEntity( "MapEnt"+i, "drone.mesh");
+                it->MapNode_->attachObject( it->MapEntity_ );
+            }
+            
+        
+            
+        }
+    }
+
     void Map::XMLPort(Element& xmlElement, XMLPort::Mode mode)
     {
         SUPER(Map, XMLPort, xmlElement, mode);
-    }
+    }	
+
+    void Map::changedOwner()
+    {
+        //COUT(0) << "shipptr" << this->getOwner()->getReverseCamera() << std::endl;
+        if(this->getOwner()->getReverseCamera())
+        {
+            //COUT(0) << "foo";
+            this->getOwner()->getReverseCamera()->attachCamera(this->mReflectCam_);
+        }
+    }
+
 
     void Map::toggleVisibility()
@@ -80,4 +218,5 @@
             this->overlay_->show();
             this->isVisible_=1;
+            //updatePositions();
         }
         else
@@ -98,4 +237,5 @@
         COUT(0) << it->isVisible_ << std::endl;
         it->toggleVisibility();
+        //it->updatePositions();
         }
     }
@@ -103,5 +243,6 @@
     void Map::tick(float dt)
     {
-        sNode_->lookAt(Vector3::NEGATIVE_UNIT_Z, Ogre::Node::TS_WORLD, Vector3::NEGATIVE_UNIT_Z);
+        //sNode_->lookAt(Vector3::NEGATIVE_UNIT_Z, Ogre::Node::TS_WORLD, Vector3::NEGATIVE_UNIT_Z);
+        updatePositions();
         
     }
Index: code/branches/map/src/orxonox/overlays/map/Map.h
===================================================================
--- code/branches/map/src/orxonox/overlays/map/Map.h	(revision 2912)
+++ code/branches/map/src/orxonox/overlays/map/Map.h	(revision 2913)
@@ -28,5 +28,5 @@
 #define _MAP_H__
 
-
+#include <string>
 #include "OrxonoxPrereqs.h"
 #include <OgrePrerequisites.h>
@@ -46,4 +46,5 @@
 
 
+
 namespace orxonox
 {
@@ -57,17 +58,25 @@
         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
         virtual void tick(float dt);
+        virtual void changedOwner();
 
-        
+        static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, std::string matName);
         
         static void openMap();
+
+        static const int maxRange_s=1000;
         
     private: // functions
         void toggleVisibility();
+        void updatePositions();
 
 
     private: // variables
         Ogre::SceneManager* sManager_;
-        Ogre::SceneNode* sNode_;
+        Ogre::SceneManager* mapSceneM_;
+        Ogre::SceneNode* rootNode_;
         Ogre::OverlayManager * oManager_;
+        Ogre::Camera* mReflectCam_;
+
+        
         
         bool isVisible_;
