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;
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);
/* 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();
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);
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;