Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
@Josh: thanks for editing –  Bunkai.Satori Feb 7 '11 at 20:29
    
add comment

closed as off-topic by Byte56 Mar 15 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." – Byte56
If this question can be reworded to fit the rules in the help center, please edit the question.

5 Answers

up vote 13 down vote accepted

Have you considered the Configurable Math Library?

share|improve this answer
    
+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
2  
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
show 5 more comments

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:
Additions: 77624 milliseconds.
Multiplications: 227179 milliseconds.

GLM:
Additions: 23935 milliseconds.
Multiplications: 80599 milliseconds.

CML:
Additions: 102390 milliseconds.
Multiplications: 161059 milliseconds.

GLKMath:
Additions: 8526 milliseconds.
Multiplications: 21775 milliseconds.

Here's my code

I don't have an Android Device, but I'm curious how GLKMath will perform on Android.

share|improve this answer
    
+1 for hard nubmers –  Eonil Jun 14 '13 at 5:42
add comment

This is an old question, but I came across a very recent article that addresses just this issue by taking into consideration performance, documentation, ease-of-use, etc...

http://www.mfoot.com/blog/2012/01/23/choosing-a-maths-library-for-cross-platform-c-game-development/

share|improve this answer
add comment

Here are 2:

  1. Sony's vectormath
  2. Bullet's Linearmath
share|improve this answer
    
+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
add comment

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

share|improve this answer
    
+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
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.