Matrix Multiplication

Is matrix multiplication dependent on whether the coordinate system
is LH or RH?

In other words, I would be using row vectors for a LH system, and
column vectors for a RH system.

Take this example:

for( INT i=0; i < 4; i++ )
for( INT j=0; j < 4; j++ )
for( INT k=0; k < 4; k++ )
M(i, j) += A(i, k) * B(k, j);

Can this function be used for both types of systems?

I’m just trying to track down some problems am I having with my math library.

[This message has been edited by Syslock (edited 07-21-2002).]

Well i only work with the right handed system but yes the matrices for both systems will be a little different. I remember reading something about the rotation matrix and how it looks different for RH and LH. I think it was on flipcode or gamedev.net. One of those two sites i read this on. It’s not likes its a HUGE diffrence though. Just a sign difference pretty much.

-SirKnight

Yes, I think the difference would be in the values you put in the matrix.

The way matrices are multiplies is always

AB = C

RH or LH is relavent to coordinate systems.

V-man

Originally posted by Syslock:
Can this function be used for both types of systems?

Yes.

So, if I was trying to import a file with a strange coordinate system,
I couldn’t use my matrix math library on it unless I correct it beforehand?

Yes you’ll have to convert it first. Once you do, your matrix library should work fine. Also both post and pre-multiplication are OK,depending on what your goal is. Both have meaning. If A and B are transform matrices and v is a column vector, then

(A * B) * v, means first apply B to v then A
(B * A) * v , means first apply A to v then B