Index: code/branches/presentation/data/levels/myTestLevel.oxw
===================================================================
--- code/branches/presentation/data/levels/myTestLevel.oxw	(revision 8705)
+++ code/branches/presentation/data/levels/myTestLevel.oxw	(revision 8710)
@@ -30,10 +30,30 @@
   >
 
-    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
-    <SpawnPoint team=0 position="0,0,0" direction="1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+    <Light type=directional position="0,0,0" direction="0.253, 0.193, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="0.1,0.1,0" yaw="-90" roll="-90" spawnclass=SpaceShip pawndesign=spaceshipassff />
     
     <SpaceBoundaries warnDistance="1" maxDistance="200" showDistance="150" reactionMode="0" healthDecrease="0.9" position="0,0,0"/>
     
-    <Billboard position="0,0,0" colour="1.0,1.0,1.0" material="Flares/backlightflare" scale=1 />
+    <Billboard position="   0,   0, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="   0,  0,200" colour="0.0,0.0,1.0" material="Flares/backlightflare" scale=0.2 />
+
+    <Billboard position=" 142, 142, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position=" 142,-142, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="-142,-142, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="-142, 142, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+
+    <Billboard position=" 200,   0, 0" colour="1.0,0.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="-200,   0, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="   0, 200, 0" colour="0.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="   0,-200, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+
+    <Billboard position=" 184,  76, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="  76, 184, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position=" -76, 184, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="-184,  76, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="-184, -76, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position=" -76,-184, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position="  76,-184, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
+    <Billboard position=" 184, -76, 0" colour="1.0,1.0,0.0" material="Flares/backlightflare" scale=0.2 />
     
   </Scene>
Index: code/branches/presentation/src/modules/objects/SpaceBoundaries.cc
===================================================================
--- code/branches/presentation/src/modules/objects/SpaceBoundaries.cc	(revision 8705)
+++ code/branches/presentation/src/modules/objects/SpaceBoundaries.cc	(revision 8710)
@@ -35,8 +35,17 @@
 #include "core/XMLPort.h"
 
+#include "util/Math.h"
+
 #include "graphics/Billboard.h"
 #include "infos/PlayerInfo.h"
 #include "worldentities/WorldEntity.h"
 #include "worldentities/pawns/Pawn.h"
+
+#ifndef PI2
+    #define PI2    1.570796327
+#endif
+#ifndef PI
+    #define PI      3.141592654
+#endif
 
 namespace orxonox
@@ -117,19 +126,49 @@
         this->billboards_[current].usedYet = true;
 
-        Vector3 directionVector = (this->getPosition() - position).normalisedCopy(); // vector from the position of the billboard to the center of the sphere
-        this->billboards_[current].billy->setCommonDirection(directionVector);
-
-        Vector3 upVector = Vector3(directionVector.z, directionVector.z, -(directionVector.x + directionVector.y)); // vector perpendicular to the direction vector
-        upVector.normalise();
-        this->billboards_[current].billy->setCommonUpVector(upVector);
+        // in order to animate the billboard, we use a        
+        // transform to spherical coordinates according to
+        // http://de.wikipedia.org/wiki/Kugelkoordinaten convention
+
+        Vector3 dirVect = position - this->getPosition();
+
+        float phi; // this is the longitude on the sphere (-pi, pi)
+        if      (dirVect.x >  0) phi = atan(dirVect.y/dirVect.x);
+        else if (dirVect.x == 0) phi = sgn(dirVect.y) * PI2;
+        else if (dirVect.y >= 0) phi = atan(dirVect.y/dirVect.x) + PI;
+        else if (dirVect.y <  0) phi = atan(dirVect.y/dirVect.x) - PI;
+        
+        float theta; // this is the latitude measured from z axis (0, pi)
+        theta = acos(dirVect.z / dirVect.length());
+
+        Vector3 e_r = dirVect.normalisedCopy();
+        //Vector3 e_phi = Vector3(-sin(phi), cos(phi), 0);
+        Vector3 e_theta = Vector3(cos(theta)*cos(phi), cos(theta)*sin(phi), -sin(theta));
+
+        // set billboard orientation
+        this->billboards_[current].billy->setCommonDirection(e_r);
+        this->billboards_[current].billy->setCommonUpVector(e_theta);
+
+        // set billboard texture coordinates
+        float u = (phi - floor(phi)) * this->maxDistance_ / 200;
+        float v = (theta -floor(theta)) * this->maxDistance_ / 200;
+        Ogre::FloatRect textureCoords = Ogre::FloatRect(0.5-u, 0.5-v, 1.0-u, 1.0-v);
+        this->billboards_[current].billy->setTextureCoords(&textureCoords, 1);
+        
+        // debug output
+        //COUT(0) << "dirVect: " << dirVect << " len: " << dirVect.length() << std::endl;
+        //COUT(0) << "phi: " << phi << std::endl;
+        //COUT(0) << "theta: " << theta << std::endl;
+        //COUT(0) << "e_r: " << e_r  << " len: " << e_r.length() << std::endl;
+        //COUT(0) << "e_phi: " << e_phi  << " len: " << e_phi.length() << std::endl;
+        //COUT(0) << "e_theta: " << e_theta  << " len: " << e_theta.length() << std::endl;
     }
     
     void SpaceBoundaries::setBillboardOptions(Billboard *billy)
     {
-        if(billy != NULL)
-        {
-            billy->setMaterial("Grid");
+        if(billy)
+        {
+            billy->setMaterial("Grid02");
             billy->setBillboardType(Ogre::BBT_PERPENDICULAR_COMMON);
-            billy->setDefaultDimensions(150, 150);
+            billy->setDefaultDimensions(100, 100);
             billy->setVisible(true);
         }
Index: code/branches/presentation/src/modules/objects/SpaceBoundaries.h
===================================================================
--- code/branches/presentation/src/modules/objects/SpaceBoundaries.h	(revision 8705)
+++ code/branches/presentation/src/modules/objects/SpaceBoundaries.h	(revision 8710)
@@ -46,5 +46,5 @@
 
 /**
-@brief SpaceBoundaries gives level creators the possibility to bar Pawns from leaving a defined area (until now this area is a ball).
+@brief SpaceBoundaries gives level creators the possibility to keep Pawns from leaving a defined area (until now this area is spherical).
 
        Some attributes can/should be defined in the XML-File:
Index: code/branches/presentation/src/orxonox/graphics/Billboard.cc
===================================================================
--- code/branches/presentation/src/orxonox/graphics/Billboard.cc	(revision 8705)
+++ code/branches/presentation/src/orxonox/graphics/Billboard.cc	(revision 8710)
@@ -145,30 +145,3 @@
         }
     }
-    
-    void Billboard::setCommonDirection(Vector3 vec)
-    {
-        Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
-        if( bSet != NULL )
-        {
-            bSet->setCommonDirection( vec );
-        }
-    }
-            
-    void Billboard::setCommonUpVector(Vector3 vec)
-    {
-        Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
-        if( bSet != NULL )
-        {
-            bSet->setCommonUpVector( vec );
-        }
-    }
-    
-    void Billboard::setDefaultDimensions(float width, float height)
-    {
-        Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
-        if( bSet != NULL )
-        {
-            bSet->setDefaultDimensions(width, height);
-        }
-    }
 }
Index: code/branches/presentation/src/orxonox/graphics/Billboard.h
===================================================================
--- code/branches/presentation/src/orxonox/graphics/Billboard.h	(revision 8705)
+++ code/branches/presentation/src/orxonox/graphics/Billboard.h	(revision 8710)
@@ -65,5 +65,4 @@
                 { return this->colour_; }
 
-
             inline void setRotation(const Radian& rotation)
                 { this->rotation_ = rotation; this->changedRotation(); }
@@ -71,4 +70,19 @@
                 { return this->rotation_; }
 
+            /// use normalised vector as argument
+            inline void setCommonDirection(const Vector3 vec)
+                { if(this->billboard_.getBillboardSet())
+                    this->billboard_.getBillboardSet()->setCommonDirection(vec); }
+            inline const Vector3 getCommonDirection()
+                { if(this->billboard_.getBillboardSet())
+                    return this->billboard_.getBillboardSet()->getCommonDirection(); }
+
+            /// use normalised vector as argument
+            inline void setCommonUpVector(const Vector3 vec)
+                { if(this->billboard_.getBillboardSet())
+                    this->billboard_.getBillboardSet()->setCommonUpVector( vec ); }
+            inline const Vector3 getCommonUpVector()
+                { if(this->billboard_.getBillboardSet())
+                    return this->billboard_.getBillboardSet()->getCommonUpVector(); }
 
             virtual void setTeamColour(const ColourValue& colour)
@@ -77,10 +91,11 @@
             void setBillboardType(Ogre::BillboardType bbt);
             
-            void setCommonDirection(Vector3 vec); //!< normalised Vector vec as argument
-            
-            void setCommonUpVector(Vector3 vec); //!< normalised Vector vec as argument
-            
-            void setDefaultDimensions(float width, float height);
+            inline void setDefaultDimensions(float width, float height)
+                { if(this->billboard_.getBillboardSet())
+                    this->billboard_.getBillboardSet()->setDefaultDimensions(width, height); }
 
+            inline void setTextureCoords(const Ogre::FloatRect* coords, unsigned int numCoords)
+                { if(this->billboard_.getBillboardSet())
+                    this->billboard_.getBillboardSet()->setTextureCoords(coords, numCoords); }
 
         protected:
