Recommendations for Vector/Matrix classes?

Started by
9 comments, last by PolyVox 15 years, 6 months ago
I began creating a Vector and a Matrix class for my game, but I doubt mine would be that sophisticated compared to the highly optimized ones already out there (why code a class that will be less efficent than one that already exists?) So I was wondering if anyone could recommend any robust, easy-to-use Vector/Matrix classes for me to use?
Advertisement
I always liked the Ogre3D math libraries. They're not perfect, but they're pretty good, and they aren't buggy, which is half the battle.
Well if you are using DirectX it has the D3DX utility library available that you can use.

"The math library provided by the D3DX utility library supplies functions to compute 3D mathematical operations. Each of the functions can take the same object as the passed [in] and returned [out] parameters. Also, out parameters are typically returned as return values, so that the output of one math function can be used as a parameter for another math function."
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by -Datriot-
I began creating a Vector and a Matrix class for my game, but I doubt mine would be that sophisticated compared to the highly optimized ones already out there (why code a class that will be less efficent than one that already exists?)
So I was wondering if anyone could recommend any robust, easy-to-use Vector/Matrix classes for me to use?
You can find a list of free game math libraries here. (Full disclosure: the list includes a library of which I am co-author. However, there are plenty of options there, so I doubt you'll have too much trouble finding something that works for you.)
Eigen 2 seems to be a very promising upcoming library. It uses expression templates and is explicitly vectorised (SSE and AltiVec). The geometry module isn't complete though, but they are looking for contributors.
Just a question: are you already good with that stuff? Implementing my own math library for my raytracer has been a VERY useful experience, I've learned a lot...
Quote:Original post by cignox1
Just a question: are you already good with that stuff? Implementing my own math library for my raytracer has been a VERY useful experience, I've learned a lot...


Moderately, I know what a vector is and many of the mathematical operations to perform on a vector. Same with matrices. The reason I wanted to create the classes myself in the first place was to learn, but quite a few people have advised me to just use already made classes.

Quote:Original post by jykYou can find a list of free game math libraries here. (Full disclosure: the list includes a library of which I am co-author. However, there are plenty of options there, so I doubt you'll have too much trouble finding something that works for you.)


Thnaks for the list, I'll definitely look into some of those.
Dave Eberly's Wild Magic Engine has always been good to me. I don't directly use his libraries, but the fancy implementations of some tough functions are very helpful. His whole engine is downloadable for free, too.
Quote:Original post by Jason Z
Dave Eberly's Wild Magic Engine has always been good to me. I don't directly use his libraries, but the fancy implementations of some tough functions are very helpful. His whole engine is downloadable for free, too.


Seconded.
Quote:Original post by Ashkan
Quote:Original post by Jason Z
Dave Eberly's Wild Magic Engine has always been good to me. I don't directly use his libraries, but the fancy implementations of some tough functions are very helpful. His whole engine is downloadable for free, too.


Seconded.


Thirded. Eberly's engine also contains collision detection and other math utils that may help you later on (for example, for scene management or collision detection).
------------Anything prior to 9am should be illegal.

This topic is closed to new replies.

Advertisement