This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "OrbitCamera.h" | |
glm::mat4 OrbitCamera::generateViewMatrix(glm::vec3 eye, glm::vec3 target, glm::vec3 up) | |
{ | |
//zAxis is the axis the viewer is looking along when the program is initialized | |
glm::vec3 zAxis = glm::normalize(eye - target); | |
glm::vec3 xAxis = glm::normalize(glm::cross(up, zAxis)); | |
glm::vec3 yAxis = glm::normalize(glm::cross(zAxis, xAxis)); | |
glm::mat4 viewMatrix = { |