Index: /branches/camera/src/world_entities/camera.cc
===================================================================
--- /branches/camera/src/world_entities/camera.cc	(revision 10064)
+++ /branches/camera/src/world_entities/camera.cc	(revision 10065)
@@ -18,4 +18,7 @@
 #include "key_mapper.h"
 #include "glincl.h"
+#include "vector.h"
+#include <iostream.h>
+
 
 ObjectListDefinition(Camera);
@@ -138,6 +141,8 @@
   this->viewVector = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized();
   this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + this->viewVector * 0.1);
-
   this->upVector =  this->getAbsDirV();
+
+
+
 
 
@@ -179,6 +184,6 @@
   Vector targetPosition = this->target->getAbsCoor();
 
-       // Setting the Camera Eye, lookAt and up Vectors
-  gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
+        //Setting the Camera Eye, lookAt and up Vectors
+  glLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
             targetPosition.x, targetPosition.y, targetPosition.z,
             this->upVector.x, this->upVector.y, this->upVector.z);
@@ -217,4 +222,76 @@
   }
 }
+
+/*
+Vector* Camera::translate(Vector* newPos, float speed)
+{
+glTranslatef(Vector);
+
+}
+
+
+float Camera::iterate(float dt, Vector target)
+{
+  Vector tmpVec = (this->getAbsCorr() - target);
+  if (tmpVec > 0.01)
+  Vector ret =  this->getAbsCorr;
+ ret += tmpVec * fabsf(dt);
+ return ret;
+}
+*/
+void Camera::Rotate()
+{
+this->fovy=this->fovy+1;
+}
+
+
+void Camera::glLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz)
+{
+  //Vector* eye=new Vector(eyex, eyey, eyez);
+  Vector* center=new Vector (centerx, centery, centerz);
+  Vector* up=new Vector(upx, upy, upz);
+
+  center->x-=eyex;
+  center->y-=eyey;
+  center->z-=eyez;
+
+  center->normalize();
+  up->normalize();
+  Vector* s = VectorProd(center, up);
+  Vector* u = VectorProd(s, center);
+  GLfloat Matrix[]={s->x, s->y, s->z, 0, u->x, u->y, u->z, 0, -center->x, -center->y, -center->z, 0, 0, 0, 0, 1};
+
+  glMultMatrixf(Matrix);
+  glTranslated(-eyex, -eyey, -eyez);
+  delete center;
+  delete up;
+  delete s;
+  delete u;
+
+}
+
+
+
+
+Vector* Camera::VectorProd(Vector* v1, Vector* v2)
+{
+Vector* temp= new Vector();
+temp->x=v1->y * v2->z - v1->z * v2->y;
+temp->y=v1->z * v2->x - v1->x * v2->z;
+temp->z=v1->x * v2->y - v1->y * v2->x;
+return temp;
+}
+
+
+
+
+
+
+
+
+
+
+
+
 
 
@@ -228,4 +305,16 @@
   this->registerObject(this, CameraTarget::_objectList);
   //  this->setParentMode(PNODE_MOVEMENT);
-}
-
+
+
+}
+
+
+CameraTarget::detach()
+{
+  State::getCameraTargetNode()->setParentSoft(NULL);
+}
+
+
+
+
+
Index: /branches/camera/src/world_entities/camera.h
===================================================================
--- /branches/camera/src/world_entities/camera.h	(revision 10064)
+++ /branches/camera/src/world_entities/camera.h	(revision 10065)
@@ -58,4 +58,7 @@
   inline float distance(const PNode* node) const { return distance(node->getAbsCoor()); }
 
+  void glLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz);
+  Vector* VectorProd(Vector* v1, Vector* v2);
+  void Rotate();
   void tick(float dt);
   void apply ();
Index: /branches/camera/src/world_entities/test_entity.cc
===================================================================
--- /branches/camera/src/world_entities/test_entity.cc	(revision 10064)
+++ /branches/camera/src/world_entities/test_entity.cc	(revision 10065)
@@ -25,5 +25,5 @@
 
 
-
+#include "material.h"
 
 #include "state.h"
@@ -73,4 +73,11 @@
   this->registerObject(this, TestEntity::_objectList);
   this->toList(OM_GROUP_00);
+
+  this->material = new Material();
+  this->material->setIllum(3);
+  this->material->setDiffuse(1.0,1.0,1.0);
+  this->material->setSpecular(0.0,0.0,0.0);
+  this->material->setAmbient(1.0, 1.0, 1.0);
+  this->material->setDiffuseMap("maps/TE2.tga");
 }
 
@@ -93,5 +100,5 @@
   glDisable(GL_LIGHTING);
 //   glDisable(GL_BLEND);
-// 
+//
 //   glEnable(GL_TEXTURE_2D);
 //   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
@@ -104,5 +111,5 @@
 //PRINTF(0)("axis: %f\n", axis);
 glEnable(GL_BLEND);	// Turn Blending On
-  
+
 
 
@@ -121,6 +128,6 @@
   glEnd();
 
- // glPopMatrix();
- // glPopAttrib();
+  glPopMatrix();
+  glPopAttrib();
 }
 
@@ -130,17 +137,13 @@
 void TestEntity::tick (float time)
 {
-if (state==0)
-i=0;
-else
-i=i+0.005;
-
-
-
-
+  if (state==0 && i==1)
+    i=0;
+  if (state==1 && i<=1)
+    i=i+0.005;
 }
 
 
-//void TestEntity::changeState (bool sta)
-//{
-//state=sta;
-//}
+void  TestEntity::changeState (bool sta)
+{
+  state=sta;
+}
Index: /branches/camera/src/world_entities/test_entity.h
===================================================================
--- /branches/camera/src/world_entities/test_entity.h	(revision 10064)
+++ /branches/camera/src/world_entities/test_entity.h	(revision 10065)
@@ -5,9 +5,13 @@
 
 class TiXmlElement;
-
+class Material;
 
 class TestEntity : public WorldEntity
 {
     ObjectListDeclaration(TestEntity);
+
+  private:
+
+    Material*       material;
 
   public:
@@ -19,5 +23,5 @@
     virtual void loadParams(const TiXmlElement* root);
 
-
+    void changeState (bool);
     virtual void tick (float time);
     virtual void draw() const;
