GLMFrom Libzter
OpenGL Mathematics
[edit] OverviewGLM is a C++ library that emulates the way vector and matrix mathematics works in GLSL. However, it is not limited to the features of GLSL, but also features extensions that can be useful when programming OpenGL. [edit] ExamplesA simple transformation function in GLM #include <glm/glm.hpp> using namespace glm; int foo() { vec4 Position = vec4(vec3(0.0), 1.0); mat4 Model = mat4(1.0); Model[4] = vec4(1.0, 1.0, 0.0, 1.0); vec4 Transformed = Model * Position; return 0; } [edit] Download[edit] API referenceUser comments on this article (GLM) |
||
Could not be a better lib for math operations in C++. At least for me when working with OpenGL it is essential to have the same format of math in the shaders as in the regular code. I am tierd of all incompatible half-optimized custom math libs for C++/opengl. Lets set a standard - GLM!