Files
vulkan-spec-walkthrough/mat.cc
T
2026-05-25 11:04:30 +01:00

20 lines
664 B
C++

#include <glm/ext/matrix_clip_space.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/trigonometric.hpp>
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/string_cast.hpp>
#include <iostream>
int main() {
glm::vec3 eye = {0.2f, 4.0f, 8.0f};
glm::vec3 center = {0.0f, 0.0f, 0.0f};
glm::vec3 up = {0.0f, 0.0f, 1.0f};
glm::mat4 view = glm::lookAt(eye, center, up);
glm::mat4 proj = glm::perspective(glm::radians(45.0f), 1600.0f / 1200.0f, 0.1f, 10.0f);
std::cout << glm::to_string(view) << '\n';
// std::cout << glm::to_string(proj) << '\n';
}