# Complete Math Library for use in OpenGL ES 2.0 Game? [closed]

Are you aware of a complete (or almost complete) cross platform math library for use in OpenGL ES 2.0 games?

The library should contain:

• Matrix2x2, Matrix 3x3, Matrix4x4 classes
• Quaternions
• Vector2, Vector3, Vector4 Classes
• Euler Angle Class
• Operations amongh the above mentioned classes, conversions, etc..
• Standardly used math operations in 3D graphics (Dot Product, Cross Product, SLERP, etc...)

Is there such Math API available either standalone or as a part of any package?

Programming Language: Visual C++ but planned to be ported to OS X and Android OS.

## closed as off-topic by MichaelHouse♦Mar 15 '14 at 16:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – MichaelHouse
If this question can be reworded to fit the rules in the help center, please edit the question.

• Related Question: gamedev.stackexchange.com/questions/12601/simd-c-library/12606 – legends2k May 8 '13 at 19:00
• There is no perfect math library for now, I just tried to write few requirements and just no library have them, well in the reality I'd like someone make a library easy as GLM with same function as shaders + the style of Ogre math library and some of its functionalities (that GLM is missin like view frustum, bounding boxes etc.) Also note that GLM is not that fast (in reality that does not matters) so i doubt someone will use it in raytracers or intensive stuff, is more usefull because of its API and design style – GameDeveloper Jul 2 '14 at 13:46

Have you considered the Configurable Math Library?

• +1 @Josh: Thanks for your good tip. I am currently considering GLM (glm.g-truc.net) GL Math library. I will wait to see what libraries people arlready have tried and have been proven as good. – Bunkai.Satori Feb 7 '11 at 20:28
• Id strongly recommend GLM. I use it and its "awesome" – brainydexter Feb 8 '11 at 6:45
• +1, I like CML a lot and would have posted that as an answer =). It does, however, depend a lot on the optimizations of the compiler, as it's generic and template based. If you're targeting a mobile device (likely as you quoted ES), some other math library may be better optimized for the target. – Jari Komppa Feb 8 '11 at 8:26
• Hi Brainy, Jari, thanks for your comments. I would still like to see, if there are more options with user feedback available, therefore, I wish to keep this question open for a while. – Bunkai.Satori Feb 8 '11 at 12:19
• @Jari - when discussing Math Library Optimization for OpenGL ES platform, what is included? I mean, if formula and data types are properly designed what else can be done to optimize the library for ES platform? (It might be elementary question, but I do not have answer for that.) – Bunkai.Satori Feb 8 '11 at 12:20

Eigen is a C++ header only math library that supports SSE, AltiVec and ARM Neon vectorisation.

• +1 for great tip. Hi Simon, thanks for your great tip. I started using GLM (OpenGL Math Library), and it is pretty amazing. It contains everything from vector, matrix, quaternion math, SLERP interpotations, etc... so far, it offers more than I realy need, so I am happy with it for now. – Bunkai.Satori May 25 '11 at 13:22

Here are 2:

• +1 for good tips. Hi Maik, thanks for your comments. In my opinion, the second might be useful especially when the game integrates Bullet Physics. My game is going to use Bullet Physics, but unfortunatelly, I have started using GLM, so I will try to stick to GLM. – Bunkai.Satori May 25 '11 at 13:26

I worked on adding Apple's GLKMath to the this test (actually forked this fork)

Here's the result on my 4 Generation iPod Touch:

Eigen:
Multiplications: 227179 milliseconds.

GLM:
Multiplications: 80599 milliseconds.

CML:
Multiplications: 161059 milliseconds.

GLKMath: