Sign in to follow this  
thecheeselover

[Answered] Good math library for OpenGL

Recommended Posts

thecheeselover    565
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 [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Share this post


Link to post
Share on other sites
clb    2147
[url="http://clb.demon.fi/MathGeoLib/"]MathGeoLib[/url] has all of the things you mention. Also, you can find other math libraries listed [url="http://clb.demon.fi/MathGeoLib/alternatives.html"]here[/url].

Share this post


Link to post
Share on other sites
jjd    2140
[quote name='thecheeselover' timestamp='1348960351' post='4985182']
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 [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]

Consider the [url="http://bulletphysics.org/wordpress/"]Bullet[/url] 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 :)

Share this post


Link to post
Share on other sites
Emergent    982
I absolutely love [url="http://eigen.tuxfamily.org/index.php?title=Main_Page"]Eigen[/url]. 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.

Share this post


Link to post
Share on other sites
l0calh05t    1796
[quote name='Emergent' timestamp='1349049397' post='4985556']
I absolutely love [url="http://eigen.tuxfamily.org/index.php?title=Main_Page"]Eigen[/url]. 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.
[/quote]

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this