Stuff
[opengl.git] / main.cpp
index f7b2f85a4644f12ba6df69a5f02363926686afe7..742c8983840eff62fbb68652ba0365fe2da0c72b 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -29,7 +29,7 @@ glm::vec3 camUp    = glm::vec3(0.0f, 1.0f,  0.0f);
 float yaw = 1.57, pitch = 0;
 bool doScale, doRotate, doTranslate;
 Model *monkeyHead, *chest;
 float yaw = 1.57, pitch = 0;
 bool doScale, doRotate, doTranslate;
 Model *monkeyHead, *chest;
-glm::vec3 chestPos(0);
+glm::vec3 lightPos(0);
 
 const int WIDTH = 800, HEIGHT = 600;
 const float ASPECT = (float)WIDTH / (float)HEIGHT;
 
 const int WIDTH = 800, HEIGHT = 600;
 const float ASPECT = (float)WIDTH / (float)HEIGHT;
@@ -157,7 +157,6 @@ void display() {
        float d = (float)glutGet(GLUT_ELAPSED_TIME) * 0.001f;
 
        /* glm::vec3 lightPos = glm::vec3(sin(d / 10.f) * 10, 0, cos(d / 10.f) * 10); */
        float d = (float)glutGet(GLUT_ELAPSED_TIME) * 0.001f;
 
        /* glm::vec3 lightPos = glm::vec3(sin(d / 10.f) * 10, 0, cos(d / 10.f) * 10); */
-       glm::vec3 lightPos = chestPos;
        glm::vec4 lightColor(1, 1, 1, 1);
 
        drawLight(d, lightPos, lightColor);
        glm::vec4 lightColor(1, 1, 1, 1);
 
        drawLight(d, lightPos, lightColor);
@@ -182,7 +181,7 @@ void display() {
        /* Model::Node *key = chest->find("key"); */
        /* key->model = glm::translate(glm::mat4(1), glm::vec3(0, 0, sin(d))); */
        
        /* Model::Node *key = chest->find("key"); */
        /* key->model = glm::translate(glm::mat4(1), glm::vec3(0, 0, sin(d))); */
        
-       /* chest->getRoot()->model = glm::translate(glm::mat4(1), chestPos); */
+       /* chest->getRoot()->model = glm::translate(glm::mat4(1), lightPos); */
        chest->draw();
 
        glutSwapBuffers();
        chest->draw();
 
        glutSwapBuffers();
@@ -486,7 +485,7 @@ void init() {
        validateProgram(textureProgId);
 
        monkeyHead = new Model("monkeyhead_smooth.dae", solidProgId);
        validateProgram(textureProgId);
 
        monkeyHead = new Model("monkeyhead_smooth.dae", solidProgId);
-       chest = new Model("chest.dae", textureProgId);
+       chest = new Model("models/chest.dae", textureProgId);
 
        glEnable(GL_DEPTH_TEST); 
        glEnable(GL_CULL_FACE); 
 
        glEnable(GL_DEPTH_TEST); 
        glEnable(GL_CULL_FACE); 
@@ -523,12 +522,12 @@ void timer(int _) {
        if (keyStates['e'])
                ySpeed = -0.1f;
 
        if (keyStates['e'])
                ySpeed = -0.1f;
 
-       if (keyStates['j']) chestPos.z += 0.1f;
-       if (keyStates['k']) chestPos.z -= 0.1f;
-       if (keyStates['h']) chestPos.x -= 0.1f;
-       if (keyStates['l']) chestPos.x += 0.1f;
-       if (keyStates['m']) chestPos.y -= 0.1f;
-       if (keyStates['n']) chestPos.y += 0.1f;
+       if (keyStates['j']) lightPos.z += 0.1f;
+       if (keyStates['k']) lightPos.z -= 0.1f;
+       if (keyStates['h']) lightPos.x -= 0.1f;
+       if (keyStates['l']) lightPos.x += 0.1f;
+       if (keyStates['m']) lightPos.y -= 0.1f;
+       if (keyStates['n']) lightPos.y += 0.1f;
 
        camPos.x += xSpeed * sin(yaw) + zSpeed * cos(yaw);
        camPos.y += ySpeed;
 
        camPos.x += xSpeed * sin(yaw) + zSpeed * cos(yaw);
        camPos.y += ySpeed;