glUniformMatrix4fv(viewId, 1, GL_FALSE, glm::value_ptr(view));
GLuint modelId = glGetUniformLocation(progId, "model");
- float d = (float)glutGet(GLUT_ELAPSED_TIME) * 0.001f;
glm::mat4 model = glm::mat4(1.f);
+ float d = (float)glutGet(GLUT_ELAPSED_TIME) * 0.001f;
model = glm::translate(model, glm::vec3(sin(i * 30) * 10, cos(i * 30) * 10, i * 2));
if (doRotate) {
keyStates[key] = false;
}
-void idle(int _) {
+void timer(int _) {
float xSpeed = 0.f, ySpeed = 0.f, zSpeed = 0.f;
if (keyStates['w'])
zSpeed = 0.1f;
glutKeyboardFunc(keyboard);
glutKeyboardUpFunc(keyboardUp);
- glutTimerFunc(16, idle, 0);
+ glutTimerFunc(16, timer, 0);
glutMotionFunc(motion);
glutMouseFunc(mouse);