- GLuint viewId = glGetUniformLocation(progId, "view");
- glm::mat4 view = glm::lookAt(camPos, camPos + camFront, camUp);
- 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);
-
- model = glm::translate(model, glm::vec3(sin(i * 30) * 10, cos(i * 30) * 10, i * 2));
-
- if (doRotate) {
- model = glm::rotate(model, d * glm::radians(30.f), glm::vec3(0.f, 1.f, 0.f));
- model = glm::rotate(model, d * glm::radians(20.f), glm::vec3(1.f, 0.f, 0.f));
+glm::mat4 projMat() {
+ return glm::perspective(glm::radians(45.f), ASPECT, 0.01f, 10000.f);