}
void display() {
+ glClearColor(0.5, 0.5, 0.5, 1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
float d = (float)glutGet(GLUT_ELAPSED_TIME) * 0.001f;
front.y = sin(pitch);
front.z = cos(pitch) * sin(yaw);
camFront = glm::normalize(front);
+
+ if (pitch < -1.57079632679 || pitch >= 1.57079632679) {
+ camUp = glm::vec3(0, -1, 0);
+ } else {
+ camUp = glm::vec3(0, 1, 0);
+ }
}
void mouse(int button, int state, int x, int y) {