Here are two codes.
glm::mat4 proj = glm::ortho ( 0.0, 1920.0, 0.0, 1080.0, -1.0, 1.0 ); glm::mat4 view = glm::translate ( glm::mat4(1.0f), glm::vec3 ( 2.0, 3.0f, 2.0f ) ); glm::mat4 result = proj * view; Here is the conclusion.
0.001042 0.000000 0.000000 0.000000 0.000000 0.001852 0.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 -1.000000 -1.000000 -0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 2.000000 3.000000 2.000000 1.000000 ======================================== 0.001042 0.000000 0.000000 0.000000 0.000000 0.001852 0.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 -0.997917 -0.994444 -2.000000 1.000000 How are these numbers, -0.997917 and -0.994444, how are they calculated? How do they multiply there? For example, from 2 to become -2, but how? And I’m looking for everything in glm, but I’ll not find it, looking for operator * for mat4.