Index: orxonox/branches/dave/src/Makefile.am
===================================================================
--- orxonox/branches/dave/src/Makefile.am	(revision 3406)
+++ orxonox/branches/dave/src/Makefile.am	(revision 3407)
@@ -36,5 +36,6 @@
 		 matrix.cc \
 		 curve.cc \
-		 glmenu_imagescreen.cc
+		 glmenu_imagescreen.cc\
+		 skybox.cc
 
 
@@ -78,5 +79,6 @@
 		 curve.h \
 		 glmenu_imagescreen.h \
-		 debug.h
+		 debug.h\
+		 skybox.h
 
 
Index: orxonox/branches/dave/src/Makefile.in
===================================================================
--- orxonox/branches/dave/src/Makefile.in	(revision 3406)
+++ orxonox/branches/dave/src/Makefile.in	(revision 3407)
@@ -63,5 +63,6 @@
 	p_node.$(OBJEXT) null_parent.$(OBJEXT) base_object.$(OBJEXT) \
 	helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \
-	matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT)
+	matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
+	skybox.$(OBJEXT)
 orxonox_OBJECTS = $(am_orxonox_OBJECTS)
 orxonox_LDADD = $(LDADD)
@@ -84,8 +85,8 @@
 @AMDEP_TRUE@	./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/orxonox.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/track.Po ./$(DEPDIR)/track_manager.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/world_entity.Po
+@AMDEP_TRUE@	./$(DEPDIR)/skybox.Po ./$(DEPDIR)/story_entity.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/texture.Po ./$(DEPDIR)/track.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -236,5 +237,6 @@
 		 matrix.cc \
 		 curve.cc \
-		 glmenu_imagescreen.cc
+		 glmenu_imagescreen.cc\
+		 skybox.cc
 
 noinst_HEADERS = ability.h \
@@ -277,5 +279,6 @@
 		 curve.h \
 		 glmenu_imagescreen.h \
-		 debug.h
+		 debug.h\
+		 skybox.h
 
 EXTRA_DIST = orxonox.conf
@@ -381,4 +384,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skybox.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
Index: orxonox/branches/dave/src/skybox.cc
===================================================================
--- orxonox/branches/dave/src/skybox.cc	(revision 3407)
+++ orxonox/branches/dave/src/skybox.cc	(revision 3407)
@@ -0,0 +1,91 @@
+
+/* Created by Dave, this file is actually quite similar to player.cc and so is 
+    skybox.h similar to player.h
+    With that said, things should be clear:)
+
+
+
+*/
+
+
+#include "skybox.h"
+#include "stdincl.h"
+#include "world_entity.h"
+#include "vector.h"
+
+
+using namespace std;
+
+Skybox::Skybox():WorldEntity()
+{  
+    //GLUquadricObj *sphereObj=0;
+    sphereObj=gluNewQuadric();
+    gluQuadricTexture(sphereObj,GL_TRUE);
+
+}
+
+Skybox::~Skybox(){}
+
+void Skybox::tick(float time){
+    this->move(time);
+}
+
+void Skybox::hit(WorldEntity* weapon,Vector loc){}
+
+void Skybox::destroy(){}
+
+void Skybox::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitlags){}
+
+void Skybox::command(Command* cmd)
+{
+    if(!strcmp(cmd->cmd, "up")) bUp=!cmd->bUp;
+    else if(!strcmp(cmd->cmd,"down"))bDown=!cmd->bUp;
+    else if(!strcmp(cmd->cmd,"left"))bLeft=!cmd->bUp;
+    else if(!strcmp(cmd->cmd,"right"))bRight=!cmd->bUp;
+
+
+}
+
+
+void Skybox::draw()
+{
+
+    glPushMatrix();
+    glTranslatef(this->getAbsCoor().x,this->getAbsCoor().y,this->getAbsCoor().z);
+    glRotatef(180.0f,0.0f,0.0f,1.0f);
+    glRotatef(45.0f,0.0,1.0f,0.0f);
+    gluSphere(sphereObj,250.0f,20,20);
+    glPopMatrix();
+
+
+}
+
+void Skybox::leftWorld(){}
+
+void Skybox::move(float time)
+{
+    Vector accel(0.0,0.0,0.0);
+    Vector direction (1.0,0.0,0.0);
+    Vector orthDirection (0.0,0.0,1.0);
+    
+    if(bUp){accel=accel+(direction*20.0f);}
+    if(bDown){accel=accel-(direction*20.0f);}
+    if(bLeft){accel=accel-(orthDirection*20.0f);}
+    if(bRight){accel=accel+(orthDirection*20.0f);}
+    
+    Vector shift(15.0f*time,0,0);
+    this->shiftCoor(&shift);
+    Vector move=accel*time;
+    this->shiftCoor(&move);
+    
+    
+    
+    
+
+
+}
+
+
+
+
+
Index: orxonox/branches/dave/src/skybox.h
===================================================================
--- orxonox/branches/dave/src/skybox.h	(revision 3407)
+++ orxonox/branches/dave/src/skybox.h	(revision 3407)
@@ -0,0 +1,31 @@
+#ifndef _SKYBOX_H
+#define _SKYBOX_H
+
+#include "world_entity.h"
+
+class Skybox: public WorldEntity
+{
+
+
+private: 
+    GLUquadricObj *sphereObj;
+    bool bUp,bDown,bLeft,bRight;
+    void move(float time);
+
+public:
+   Skybox();
+   ~Skybox();
+   
+   virtual void tick(float time);
+   virtual void hit(WorldEntity* weapon, Vector loc);
+   virtual void destroy();
+   virtual void collide(WorldEntity* other, Uint32 ownhitlags, Uint32 otherhitflags);
+   virtual void command(Command* cmd);
+   virtual void draw();
+   virtual void leftWorld();
+   
+};
+
+#endif
+
+
Index: orxonox/branches/dave/src/stdincl.h
===================================================================
--- orxonox/branches/dave/src/stdincl.h	(revision 3406)
+++ orxonox/branches/dave/src/stdincl.h	(revision 3407)
@@ -26,4 +26,5 @@
 #include <GL/gl.h>
 #include <GL/glu.h>
+
 #else
 #include <SDL.h>
Index: orxonox/branches/dave/src/world.cc
===================================================================
--- orxonox/branches/dave/src/world.cc	(revision 3406)
+++ orxonox/branches/dave/src/world.cc	(revision 3407)
@@ -28,4 +28,5 @@
 #include "helper_parent.h"
 #include "glmenu_imagescreen.h"
+#include "skybox.h"
 #include "importer/material.h"
 
@@ -289,4 +290,8 @@
 	    orx->getLocalInput()->bind (myPlayer);
 	    
+	    // create skybox
+	    
+	    this->skybox = new Skybox();
+	    	    
 	    // bind camera
 	    this->localCamera = new Camera(this);
@@ -333,5 +338,5 @@
 	    this->pathnodes[5] = Vector(30, 50, 0);
 	    
-
+	    
 
 
@@ -371,14 +376,7 @@
 
   // initialize debug coord system
-  //fog initialisation
+  
  
-  //float fog_color[]={0.8f,0.8f,0.2f,1.0f};
-  
-  //glEnable(GL_FOG);
-  //glLoadIdentity();
-  //glFogi(GL_FOG_MODE,GL_EXP);
-  //glFogf(GL_FOG_DENSITY,.02f);
-  //glFogfv(GL_FOG_COLOR,fog_color);
-  //glClearColor(.8f,.8f,.8f,1.0f);
+  
   
     
@@ -389,5 +387,18 @@
   // Setting the illumination mode otherwise it is flat-shaded.
   boden->setIllum(3);
-
+  
+  //Initializing the Sky, and loading a Texture into it.
+  //GLUquadricObj *sphereObj=0;
+  //sphereObj=gluNewQuadric();
+  //gluQuadricTexture(sphereObj,GL_TRUE);
+  
+  
+  Material* sky = new Material("Sky");
+  sky->setDiffuseMap("../data/pictures/sky-replace.jpg");
+  sky->setIllum(2);
+  
+  
+  
+  
   objectList = glGenLists(1);
   glNewList (objectList, GL_COMPILE);
@@ -451,5 +462,5 @@
       }
 
-  int snowheight=13;
+  
   for ( int i = 0; i<sizeX; i+=1)
     for (int j = 0; j<sizeZ;j+=1)
@@ -464,17 +475,5 @@
 	a[2]=1.0;
 	glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	/*if(height[i][j]<snowheight){
-	  a[0]=0;
-	  a[1]=1.0-height[i][j]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	    a[0]=1.0;
-	    a[1]=1.0;
-	    a[2]=1.0;
-	    glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	    
-	}*/
+	
 	glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
 	glTexCoord2f(0.0f,0.0f);
@@ -482,51 +481,15 @@
 	glVertex3f(v1.x, v1.y, v1.z);
 	
-	/*
-	if(height[i+1][j]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}*/
+	
 	glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
 	glTexCoord2f(1.0f,0.0f);
 	//glTexCoord2f((float)(i+1.0)/(float)sizeX,(float)j/(float)sizeZ);
 	glVertex3f(v2.x, v2.y, v2.z);
-	/*
-	if(height[i+1][j+1]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j+1]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}*/
+	
 	glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
 	glTexCoord2f(1.0f,1.0f);
 	//glTexCoord2f((float)(i+1.0)/(float)sizeX,(float)(j+1.0)/(float)sizeZ);
 	glVertex3f(v3.x, v3.y, v3.z);
-	/*
-	if(height[i][j+1]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j+1]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}*/
+	
 	glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
 	glTexCoord2f(0.0f,1.0f);
@@ -541,44 +504,5 @@
   glDisable(GL_TEXTURE_2D);
 
-  /*  
-  glBegin(GL_LINES);
-  for( float x = -128.0; x < 128.0; x += 25.0)
-    {
-      for( float y = -128.0; y < 128.0; y += 25.0)
-	{
-	  glColor3f(1,0,0);
-	  glVertex3f(x,y,-128.0);
-	  glVertex3f(x,y,0.0);
-	  glColor3f(0.5,0,0);
-	  glVertex3f(x,y,0.0);
-	  glVertex3f(x,y,128.0);
-	}
-    }
-  for( float y = -128.0; y < 128.0; y += 25.0)
-    {
-      for( float z = -128.0; z < 128.0; z += 25.0)
-	{
-	  glColor3f(0,1,0);
-	  glVertex3f(-128.0,y,z);
-	  glVertex3f(0.0,y,z);
-	  glColor3f(0,0.5,0);
-	  glVertex3f(0.0,y,z);
-	  glVertex3f(128.0,y,z);
-	}
-    }
-  for( float x = -128.0; x < 128.0; x += 25.0)
-    {
-      for( float z = -128.0; z < 128.0; z += 25.0)
-	{
-	  glColor3f(0,0,1);
-	  glVertex3f(x,-128.0,z);
-	  glVertex3f(x,0.0,z);
-	  glColor3f(0,0,0.5);
-	  glVertex3f(x,0.0,z);
-	  glVertex3f(x,128.0,z);
-	}
-      
-    }
-  */  
+  
   //draw track
   glBegin(GL_LINES);
@@ -591,13 +515,5 @@
   glEnd();
   
-  /*
-  glBegin(GL_LINE_STRIP);
-  glColor3f(1.0, 5.0, 1.0);
-  for( int i = 0; i <= 30; i++)
-    {
-      glEvalCoord1f ((GLfloat) i/30.0);
-    }
-  glEnd();
-  */
+
 
   trackManager->drawGraph(.01);
@@ -605,17 +521,11 @@
   delete trackManager;
   
-  /*
-  glBegin(GL_LINES);
-  float i;
-  for(i = 0.0; i<1; i+=.01)
-    {
-      printf("%f, %f, %f\n",tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
-      glVertex3f(tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
-    }
-  glEnd();
-  */
-  glEndList();
-  
-  
+
+  
+  glEnable(GL_TEXTURE_2D);
+  sky->select();
+  skybox->draw();
+  
+  glEndList();  
 }
 
Index: orxonox/branches/dave/src/world.h
===================================================================
--- orxonox/branches/dave/src/world.h	(revision 3406)
+++ orxonox/branches/dave/src/world.h	(revision 3407)
@@ -10,4 +10,5 @@
 #include "stdincl.h"
 #include "story_entity.h"
+#include "skybox.h"
 class Material;
 
@@ -85,4 +86,5 @@
 
   WorldEntity* localPlayer;
+  Skybox* skybox;
  
   PNode* nullParent;
