Jump to content

  • Log In with Google      Sign In   
  • Create Account


[Answered] Good math library for OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 thecheeselover   Members   -  Reputation: 318

Like
0Likes
Like

Posted 29 September 2012 - 05:12 PM

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 Posted Image
Hide yo cheese! Hide yo wife!

Sponsor:

#2 rocklobster   Members   -  Reputation: 415

Like
3Likes
Like

Posted 29 September 2012 - 10:59 PM

I've used GLM. Header file only math library, the syntax is similar to the shader language GLSL though.

#3 clb   Members   -  Reputation: 1778

Like
1Likes
Like

Posted 30 September 2012 - 01:19 AM

MathGeoLib has all of the things you mention. Also, you can find other math libraries listed here.
Me+PC=clb.demon.fi | C++ Math and Geometry library: MathGeoLib, test it live! | C++ Game Networking: kNet | 2D Bin Packing: RectangleBinPack | Use gcc/clang/emcc from VS: vs-tool | Resume+Portfolio | gfxapi, test it live!

#4 jjd   Crossbones+   -  Reputation: 2074

Like
2Likes
Like

Posted 30 September 2012 - 05:29 PM

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 Posted Image


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 :)

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet


#5 Emergent   Members   -  Reputation: 971

Like
2Likes
Like

Posted 30 September 2012 - 05:56 PM

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.

#6 l0calh05t   Members   -  Reputation: 662

Like
1Likes
Like

Posted 01 October 2012 - 02:09 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS