Hi,
I've been recently searching for a good xna-like math library for C++ preferably OpenGL friendly without any good result. I'm a C# programmer who started to learn C++ two weeks ago, so that's why I don't like C++ libraries mapped from C (I can't stand and I'm not used to dirty code and not object-oriented programming). I found GLM and CML, but it seems like there aren't enough tutorials and documentation.
This is what I absolutely need:
-> 3D Vector class with math functions like the dot product and the cross product. Needs to be able to be transformed by a matrix.
-> 2D Vector class with basic math functions. Needs to be able to be transformed by a matrix.
-> Matrix4x4 (int, float, and/or double) class that with view, orthogonal and perspective projection, rotation, translation and scale functions.
Extra stuff:
-> Basic collision detection (view frustum, AAB, ray...)
Thank you for your help
[Answered] Good math library for OpenGL
I've used GLM. Header file only math library, the syntax is similar to the shader language GLSL though.
Hi,
I've been recently searching for a good xna-like math library for C++ preferably OpenGL friendly without any good result. I'm a C# programmer who started to learn C++ two weeks ago, so that's why I don't like C++ libraries mapped from C (I can't stand and I'm not used to dirty code and not object-oriented programming). I found GLM and CML, but it seems like there aren't enough tutorials and documentation.
This is what I absolutely need:
-> 3D Vector class with math functions like the dot product and the cross product. Needs to be able to be transformed by a matrix.
-> 2D Vector class with basic math functions. Needs to be able to be transformed by a matrix.
-> Matrix4x4 (int, float, and/or double) class that with view, orthogonal and perspective projection, rotation, translation and scale functions.
Extra stuff:
-> Basic collision detection (view frustum, AAB, ray...)
Thank you for your help
Consider the Bullet library. It has a linear math library that contains all of the math functions you mentioned, and it has direct support for openGL matrices. And since it is a physics library it also provides all of the collision detection you a likely to need
I absolutely love Eigen. That said, it's more of a general-purpose linear algebra library than a "graphics math" library. Still, the syntax is hard to beat. Beautiful template magic.
I absolutely love Eigen. That said, it's more of a general-purpose linear algebra library than a "graphics math" library. Still, the syntax is hard to beat. Beautiful template magic.
I can only second the suggestion of Eigen. It's a great library. No projective transforms are included though, but it is easy enough to implement those.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement