Index: /trunk/src/lib/graphics/importer/md2Model.cc
===================================================================
--- /trunk/src/lib/graphics/importer/md2Model.cc	(revision 5084)
+++ /trunk/src/lib/graphics/importer/md2Model.cc	(revision 5085)
@@ -169,5 +169,6 @@
   glPushMatrix();
 
-  this->renderFrame();
+    this->renderFrameGLList();
+//  this->renderFrameTriangles();
 
   glPopMatrix();
@@ -178,5 +179,5 @@
   \brief this is an internal function to render this special frame selected by animate()
 */
-void MD2Model::renderFrame()
+void MD2Model::renderFrameGLList()
 {
   static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
@@ -209,4 +210,5 @@
       for(; i > 0; i--, pCommands += 3) /* down counting for loop, next 3 gl commands */
         {
+ verticesList[pCommands[2]][2]);
           glTexCoord2f( ((float *)pCommands)[0], ((float *)pCommands)[1] );
           glNormal3fv(anorms[this->data->pLightNormals[pCommands[2]]]);
@@ -216,4 +218,54 @@
 
     }
+  glDisable(GL_CULL_FACE);
+  glPopAttrib();
+}
+
+
+/**
+ *  renders the frame using triangles
+ */
+void MD2Model::renderFrameTriangles()
+{
+  static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
+  int* pCommands = this->data->pGLCommands;
+
+  /* some face culling stuff */
+  glPushAttrib(GL_POLYGON_BIT);
+  glFrontFace(GL_CW);
+  glEnable(GL_CULL_FACE);
+  glCullFace(GL_BACK);
+
+  this->processLighting();
+  this->interpolate(verticesList);
+  this->data->material->select();
+
+  /* draw the triangles */
+  glBegin(GL_TRIANGLES);
+
+  for( int i = 0, k = 0; i < this->data->numTriangles; ++i, k += 3)
+  {
+    printf("%i: (%f, %f)\n", i, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s, (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t);
+
+    glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].s,
+                 (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[0]].t);
+    //glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z);
+    glVertex3fv(verticesList[this->data->pTriangles[i].indexToVertices[0]]);
+
+    glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].s,
+                  (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[1]].t);
+
+//    glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z);
+    glVertex3fv(verticesList[this->data->pTriangles[i].indexToVertices[1]]);
+
+    glTexCoord2f((float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].s,
+                  (float)this->data->pTexCoor[this->data->pTriangles[i].indexToTexCoor[2]].t);
+//    glNormal3f(Md2Model.normal[i].x, Md2Model.normal[i].y, Md2Model.normal[i].z);
+    glVertex3fv(verticesList[this->data->pTriangles[i].indexToVertices[2]]);
+  }
+
+  glEnd();
+
+
   glDisable(GL_CULL_FACE);
   glPopAttrib();
@@ -288,8 +340,10 @@
   this->pGLCommands = NULL;
   this->pLightNormals = NULL;
+  this->pTexCoor = NULL;
 
   this->numFrames = 0;
   this->numVertices = 0;
   this->numGLCommands = 0;
+  this->numTexCoor = 0;
 
   this->scaleFactor = 0.2f;
@@ -313,4 +367,5 @@
   delete [] this->pGLCommands;
   delete [] this->pLightNormals;
+  delete [] this->pTexCoor;
 
   delete this->material;
@@ -354,4 +409,5 @@
   this->numTriangles = this->header->numTriangles;
   this->numGLCommands = this->header->numGlCommands;
+  this->numTexCoor = this->header->numTexCoords;
   /* allocate memory for the data storage */
   this->pVertices = new sVec3D[this->numVertices * this->numFrames];
@@ -359,28 +415,6 @@
   this->pLightNormals = new int[this->numVertices * this->numFrames];
   this->pTriangles = new sTriangle[this->numTriangles];
+  this->pTexCoor = new sTexCoor[this->numTexCoor];
   buffer = new char[this->numFrames * this->header->frameSize];
-
-  /*
-  TriangleList = new stTriangleIndice[md2Header.numTriangles];
-
-  // Next extract the data by moving to the spot in the data where the triangle data start.
-  stTriangleIndice *pTriList;
-
-  // Get the data.
-  pTriList = (stTriangleIndice*)&buffer[md2Header.offsetTriangles];
-
-  // Now we pretty much store the data in our TriangleList object.
-  for(i = 0; i < md2Header.numTriangles; i++)
-    {
-      TriangleList[i].triIndex[0] = pTriList[i].triIndex[0];
-      TriangleList[i].triIndex[1] = pTriList[i].triIndex[1];
-      TriangleList[i].triIndex[2] = pTriList[i].triIndex[2];
-      TriangleList[i].texCoordIndex[0] = pTriList[i].texCoordIndex[0];
-      TriangleList[i].texCoordIndex[1] = pTriList[i].texCoordIndex[1];
-      TriangleList[i].texCoordIndex[2] = pTriList[i].texCoordIndex[2];
-    }
-  */
-
-
 
 
@@ -394,4 +428,11 @@
   fseek(pFile, this->header->offsetTriangles, SEEK_SET);
   fread(this->pTriangles, sizeof(sTriangle), this->numTriangles, pFile);
+  /*  read in texture coordinates */
+  fseek(pFile, this->header->offsetTexCoords, SEEK_SET);
+  fread(this->pTexCoor, sizeof(sTexCoor), this->numTexCoor, pFile);
+  for( int i = 0; i < this->numTexCoor; ++i)
+  {
+    printf("%i: (%i, %i)\n", i, this->pTexCoor[i].s, this->pTexCoor[i].t);
+  }
 
   for(int i = 0; i < this->numFrames; ++i)
Index: /trunk/src/lib/graphics/importer/md2Model.h
===================================================================
--- /trunk/src/lib/graphics/importer/md2Model.h	(revision 5084)
+++ /trunk/src/lib/graphics/importer/md2Model.h	(revision 5085)
@@ -66,4 +66,5 @@
 
 
+
 //! animation names enumeration
 typedef enum animType
@@ -116,4 +117,5 @@
   int                numVertices;           //!< number of vertices
   int                numTriangles;          //!< number of triangles
+  int                numTexCoor;            //!< number of texture coordinates
   int                numGLCommands;         //!< number of gl commands in the glList (tells how to draw)
   char*              fileName;              //!< file name of the model File
@@ -123,4 +125,5 @@
   sVec3D*            pVertices;             //!< pointer to the vertices data block
   sTriangle*         pTriangles;            //!< pointer to the triangles data
+  sTexCoor*          pTexCoor;              //!< pointer to the texture coordinate data
   int*               pGLCommands;           //!< pointer to the gllist data block
   int*               pLightNormals;         //!< pointer to the light normals
@@ -129,4 +132,6 @@
   float              scaleFactor;           //!< the scale factor of the model, (global)
 };
+
+
 
 
@@ -155,5 +160,6 @@
   void processLighting();
   void interpolate(sVec3D* verticesList);
-  void renderFrame();
+  void renderFrameGLList();
+  void renderFrameTriangles();
 
  public:
Index: /trunk/src/story_entities/world.cc
===================================================================
--- /trunk/src/story_entities/world.cc	(revision 5084)
+++ /trunk/src/story_entities/world.cc	(revision 5085)
@@ -415,7 +415,8 @@
 
   TestEntity* testEntity2 = new TestEntity();
-  testEntity2->setAnim(RUN);
-  testEntity2->setRelCoor(Vector(2400, 25, 260));
+  testEntity2->setAnim(STAND);
+  testEntity2->setRelCoor(Vector(5.0, 0.0, 5.0));
   testEntity2->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
+  testEntity2->setParent(this->localPlayer);
   this->spawn(testEntity2);
 
Index: /trunk/src/world_entities/test_entity.cc
===================================================================
--- /trunk/src/world_entities/test_entity.cc	(revision 5084)
+++ /trunk/src/world_entities/test_entity.cc	(revision 5085)
@@ -32,5 +32,5 @@
 
 //   this->md2Model = new MD2Model("models/tris.md2", "models/tris.pcx");
-  this->md2Model = new MD2Model("models/tris.md2", "maps/tris.pcx");
+ this->md2Model = new MD2Model("models/goblin.md2", "maps/goblin.bmp");
   this->obbTree = new OBBTree(15, (sVec3D*)this->md2Model->data->pVertices, this->md2Model->data->numVertices);
 
