Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- glm::mat4 Camera::GetOrientation() const
- {
- glm::mat4 mat(1);//identity matrix
- mat *= glm::rotate(glm::radians(_verticalAngle), glm::vec3(1, 0, 0));//rotate vertical (around the x axis)
- mat *= glm::rotate(glm::radians(_horizontalAngle), glm::vec3(0, 1, 0));//rotate horizontal (around the y axis)
- //no need to rotate around the z axis. Keep in mind that the rotation order is important in order to avoid gimbal lock.
- return mat;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement