10 #include <gtest/gtest.h>
13 #include <Eigen/Dense>
17 #if defined(USE_GLM_GROUND_TRUTH)
18 #define GLM_ENABLE_EXPERIMENTAL
19 #include <glm/gtc/matrix_transform.hpp>
20 #include <glm/gtc/type_ptr.hpp>
21 #include <glm/gtx/string_cast.hpp>
22 #include <glm/mat4x4.hpp>
23 #include <glm/vec3.hpp>
24 #include <glm/vec4.hpp>
27 TEST(OpenGL, perspectiveMatrix)
29 float zmin = 0.1f, zmax = 100.0f;
30 float fovy_deg = 45.0f;
31 size_t view_w = 640, view_h = 480;
43 #if defined(USE_GLM_GROUND_TRUTH)
44 glm::mat4 Projection = glm::perspective(
51 "[1.810660 0.000000 0.000000 0.000000;"
52 "0.000000 2.414213 0.000000 0.000000;"
53 "0.000000 0.000000 -1.002002 -1.000000;"
54 "0.000000 0.000000 -0.200200 0.000000"
66 float left = -4.0f, right = 6.0f;
67 float top = 10.0f, bottom = -2.0f;
68 float zmin = 0.1f, zmax = 100.0f;
75 #if defined(USE_GLM_GROUND_TRUTH)
76 glm::mat4 Projection = glm::ortho(left, right, bottom, top, zmin, zmax);
82 "[0.200000 0.000000 0.000000 0.000000;"
83 "0.000000 0.166667 0.000000 0.000000;"
84 "0.000000 0.000000 -0.020020 0.000000;"
85 "-0.200000 -0.666667 -1.002002 1.000000"