tags:

views:

1681

answers:

3

Hi

What's the best, complex math library in c++? (I'd like to use it in graphics engine)

EDIT: I should precise it a bit: it should have all 3d math, like planes, spheres, points, AABB, etc. and of course matrix, vector, quaternion support.

+1  A: 

It dependes on What you are going to develop . as per my knowledge these are good libs .

Geometric Tools (previously known as WildMagic)

OxMath 2D/3D Math Library 2.1

MATHLIB3D

Configurable Math Library (CML)

glmath

joe
I will try Math lib from Geometric Tools - it seems to be what I'm looking for but I will have to check it deeply before I will use it
chris
+1  A: 

Do you mean best as in speed? If you are writing for Windows, and you are talking about vector math, matrix math, and the like, I have not run across anything faster than the Math functions in DirectX/XNA. (D3DX)

DirectX does not offer complex number support; it deals with floats, but I don't think people use complex numbers in graphics engines very often. It would be easy enough to implement if you had to have it.

R Ubben
"The best" means for me that it should have all 3d math, like planes, spheres, points, AABB, etc. and of course matrix, vector, quaternion support.
chris
D3DX math functions are all static, and will handle all the basic math, up to and including quats, triangle hit tests and AABB intersection tests. (Though last I looked, the AABB test will not give you an interesction point, just true/false; a minor disappointment) The rest of the stuff like quads, spheres, boxes, cylinders and so on are not difficult to implement using their math underneath. They are fast and pretty comprehensive.
R Ubben
I can implement whole math library on myself :) But I don't like to reinvent the wheel and I'm looking for something checked. D3DX is too simple for me and lacks too many of features I'd like to have.
chris
I know what you mean. I like writing raytracers and experimenting with intersection routines and acceleration structures - BHV, grid, kd tree and so on - but the 10th time you implement a vector math library, it starts to get old. That's why I like D3DX. Fast, easy to build on and useable from C, C++, C#.
R Ubben
A: 

Did you try the Boost Library from http://www.boost.org/ ?

It won't give the best performance, but it is pretty standard and cross platform.

J-16 SDiZ
I'm sorry, but boost is a collections of libraries, not a 3D math library.The question is pretty vague, but so is this answer
Edison Gustavo Muenz
boost do have quaternion
J-16 SDiZ