Looking for a good vector/matrix library

Started by
4 comments, last by martin_bfg10k 16 years, 8 months ago
i've been testing boost, but it doesn't provide geometrical things like the crossproduct of vectors, or reflecting it, etc. i can't use any library whose licence forces me to publish the source code (and im not the one deciding that). i'd like it to be templatized, preferably SIMD optimized, and with (at least optional) column major matrixes (so i can use them with opengl with ease). any ideas? (yes, i've been googling, but i was not convinced).
http://www.teatromagico.net
Advertisement
Quote:Original post by ElPeque2
i've been testing boost, but it doesn't provide geometrical things like the crossproduct of vectors, or reflecting it, etc.

i can't use any library whose licence forces me to publish the source code (and im not the one deciding that).

i'd like it to be templatized, preferably SIMD optimized, and with (at least optional) column major matrixes (so i can use them with opengl with ease).

any ideas?

(yes, i've been googling, but i was not convinced).
Hi ElPeque2,

I've already been in touch with you via PM, but I'll go ahead and post here as well (just to make sure you get all your questions answered!).

Basically, the CML meets all of your stated requirements except for SIMD optimization: it's distributed under the Boost Software License (which is just about the least restrictive license out there, at least as far as I know - in any case, you do not have to publish your own source code when using the CML); it supports any combination of row- or column-major matrices and row- or column-vector notation, and exposes several other options via template configuration as well; it's fully compatible with OpenGL (and D3D/DirectX); and it has a comprehensive library of geometrical and transform-related functions for both 2d and 3d.

Regarding the SIMD thing, our first goal with the CML was portability, so we haven't tackled the problem of platform-specific optimizations yet. With a decent compiler, the CML should perform as well as hand-written C code, but if you find that this doesn't meet your performance requirements, there are ways to use the CML alongside another (SIMD-accelerated) library (thereby benefiting from the CML's large collection of transform and utility functions).

Anyway, having gotten the obligatory self-promotion out of the way, I'll say that there are enough free math libraries floating around out there that you may very well be able to find an OpenGL-compatible library with a friendly license that is also SIMD-accelerated. I myself can't think of any such libraries at the moment, but maybe someone else can provide some additional info in this area.
You might like to check out Sony's Vector Math Library, which although was originally developed for the PS3, also comes with a SIMD (SSE) version for x86, and a portable scalar version for other platforms.

It was recently made open source via Erwin Coumans bullet library, and you can download it here...

http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1322
i've been playing with CML which has everything im asking for, except SIMD (not that important anyway). Until now, it's working fine.

I'd just like to test "all" the alternatives before i marry any library.

Same with women, so i guess ill never get marryed XD.

thanks to both of you :).

Oh! by the way, what is the BSD licence like? Do i have to publish the source with the project??
http://www.teatromagico.net
another question!

what happens when you have multiple libraryes with different licence types in the same project?

how do you show that? copypaste 'em all in a txt file and put it with the distribution?
http://www.teatromagico.net
MathGL++ is a good library for vector and matrix operations with OpenGL. Is LGPL license, so it doesn't force you to distribute your source code.

[Edited by - martin_bfg10k on August 13, 2007 11:29:34 PM]

This topic is closed to new replies.

Advertisement