Advertisement
alestane

Rotating

Feb 28th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1.     camera.rotation = glm::normalize(glm::angleAxis(1.0f/75.0f, vec3{1.0f,0.0f,  0.0f}) * camera.rotation);
  2.     vec3 target = camera.rotation * vec3{0.0f, 0.0f, -1.0f};
  3.     mat4 camera_mat = glm::lookAt(camera.position, target, vec3{ 0.0f, 1.0f, 0.0f });
  4.     glUniformMatrix4fv(glGetUniformLocation(plain, "camera"), 1, GL_FALSE, glm::value_ptr(camera_mat));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement