Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Maths!

Started by golgoth Aug 30, 2005 at 3:11 PM 22 replies 2.7k views
Original Post
golgoth
golgoth
Hi all! what will be the most reliable math ressource for: vector2 vector3 vector4 matrix3 matrix4 and quaternion (optional) thx
golgoth
golgoth
what i meant is:

what will be the most reliable math "C++ source code" for:
frob
frob
There are tons of libraries out there. Assuming you are on DX, use the DX provided library. Otherwise, the Intel Small Matrix Library (free, somewhere in the Intel site) is good, optimized for both SSE and SSE2.

frob.
Axiverse
Axiverse
If you just want some articles, there are some greate articles under the math section. (Click articles on the top bar under resources if you haven't seen it yet)
ostamo1
ostamo1
3dbuzz.com just released some MATH vtm's....i think they go over vectors....
golgoth
golgoth
Thx for all the suggestions...

but for some reasons im not surprised there is no tangible vector, matrices and quaternion package in there!

there is no well known ressource?

thx
blizzard999
blizzard999
Quote:
Original post by iMalc
[cool]Here is an excellent module for exactly what you are looking for![cool]


Great! Tim Sweeney is the main author behind Unreal (another great source)

ajas95
ajas95
Don't worry about things that brag about being "SIMD/SSEx optimized". It's total crap. (I've written many thousands of lines of 'real' optimized SSE, so I know.) Just get a nice math lib that does what you need (Ogre3d.org's was pretty thorough).

Some routines that are math-heavy will benefit impressively from SIMD but they need to be written specifically for it, and that is not trivial. Don't think that some 'optimized' math lib will magically do that part for you.
iMalc
iMalc
Quote:
Original post by golgoth
Thx for all the suggestions...

but for some reasons im not surprised there is no tangible vector, matrices and quaternion package in there!

there is no well known ressource?

thx
What, "Tangible"?!?! you wanted one that you could physically touch?[lol]

I don't understand how the link I posted couldn't be exactly what you were looking for. Maybe you need to better explain what you're after.
random_thinker
random_thinker
If you want to look at one of the world's more sophisticated C++ sources, go to http://www.oonumerics.org/blitz/

--random-thinker
--random_thinkerAs Albert Einstein said: 'Imagination is more important than knowledge'. Of course, he also said: 'If I had only known, I would have been a locksmith'.
frob
frob
Quote:
Original post by ajas95
Don't worry about things that brag about being "SIMD/SSEx optimized". It's total crap. Just get a nice math lib that does what you need.
Some routines that are math-heavy will benefit impressively from SIMD but they need to be written specifically for it, and that is not trivial. Don't think that some 'optimized' math lib will magically do that part for you.

I agree about it generally being crap since SIMD programming is not a trivial task. Let the optimizing compiler handle that for you and spend your time on low-hanging fruit.

In reference to the intel SML libraries specifically, if you use them as your only storage for vector and matrix storage, they have a small performance benefit. Obviously this means non-DX rendering, and perhaps a slowdown when interfacing with your physics engine unless they have an interface for MMX/XXM data transfers, as a few commercial engines do.

The intel Small Matrix Library is from the chip manufacturer who designed SSE. The code has been extensively reviewed by various communities. They have the normal 3x1, 1x3, 3x3, 3x4, 4x4, etc. matrix items, which are not difficult to find and aren't that much of a performance gain in practice. The bigger benefit in my mind is their arbitrary-sized matrix routines optimized for SSE, and generation of specifically-sized matrix routines that can be further optimized by the compiler. This is useful when maniuplating Voroni/Delaunay calculations or other matrix-heavy calculations. I'm not aware of a faster, more efficient general purpose matrix library for the PC.

If somebody is looking for a good, fast matrix library for a non-DX application, the intel SML is a great solution.

frob.
golgoth
golgoth
u mean this?

http://www.intel.com/design/pentiumiii/sml/

The demo is already precompiled as a dll... im still looking for the source!

thx again

[Edited by - golgoth on September 1, 2005 11:13:09 AM]
Raghar
Raghar
Quote:
Original post by golgoth

The demo is already precompiled as a dll... im still looking for the source!

thx again


https://vecmath.dev.java.net/

There is a readable source. IIRC with something like quaternions as well.
frob
frob
Quote:
Original post by golgoth
The demo is already precompiled as a dll... im still looking for the source!

That is a fairly old link. The source is available at the wayback machine for that URL. That old version only supports basic things like matrix identity loading, multiply, cross products, and the like. Those are a dime a dozen, and probably what the other posters were referring to.

You asked about 'a reliable math resource' for matrix and vector math, not just a trivial matrix multiply tool. As I said in my last post, if that's all you're looking for, don't bother with any particular matrix library. The real benefit is for actually important matrix operations. Trivial matrix operations don't benefit very much from this type of library, and may actually be slower from switching the FPU/MMX/XMM state so often.

The current version of the SML has many USEFUL and FAST matrix functions, such as finding the trace, determinent, norms, and various decomposition functions including LU, Cholesky, and QR decomposition. It also has some linear equation solvers, but there are faster (less stable) algorithms that are normally used in games at runtime. (Of course, importing maps and offline/development processing can benefit from these.)

These operations are VERY useful if you decide to manipulate connectivity graphs, write an AI that's smarter than a simple state machine or can intellegently handle user-provided maps, or implement many other 'serious' algorithms.

The SML is currently part of the Integrated Performance Primatives library. (cheap $, free for noncommercial).

We use the IPP for a few things, and the dlls provided are nicely optimized with runtime CPU selection, 64-bit support, HT support, multi-core support, and similar niceties for a wide range of algorithms. The entire IPP package is about 150 MB.

frob.
golgoth
golgoth
I think this will be the best bet so far for realtime 3d:

http://www.intel.com/design/pca/applicationsprocessors/swsup/gppv40_linux.htm

I ll look into it!

THX for the reliable ressource!
random_thinker
random_thinker
Has anyone used the Intel math library on non-intel processors? And do you need an Intel compiler to use it?

--random_thinker
--random_thinkerAs Albert Einstein said: 'Imagination is more important than knowledge'. Of course, he also said: 'If I had only known, I would have been a locksmith'.
frob
frob
Quote:
Original post by random_thinker
Has anyone used the Intel math library on non-intel processors? And do you need an Intel compiler to use it?

The IPP libraries work just fine on AMD chips. It unfortunately doesn't use AMD-specific instructions, but it does pick the fastest set of routines in it's library for the chipset, including dual-CPU using OpenMP (mostly of interest in the image processing libraries of the IPP).

frob.
golgoth
golgoth
Humm... which one will you recommand for realtime 3d on pc?

from this link:

http://www.intel.com/cd/software/products/asmo-na/eng/perflib/index.htm

thx

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.