Performer matrix mathematics

New Message Reply Date view Thread view Subject view Author view

From: Thomas Proell (thomas.proell++at++ei.tum.de)
Date: 11/08/2001 12:52:44


Hi all!

I seem to have a problem with the performer mathematics. The Performer
Matrix Operations are not compatible with mine ;-)
Well, then: I have a random matrix:

a b c d
e f g h
i j k l
0 0 0 1

and I want to move the system by the values x=2, y=3, z=4.

The first idea: edit the last column with 'pfSetCol':
a b c d+2
e f g h+3
i j k l+4
0 0 0 1

The second idea: multiply with a translation matrix:
1 0 0 2 a b c d a b c d+2
0 1 0 3 e f g h e f g h+3
0 0 1 4 * i j k l = i j k l+4
0 0 0 1 0 0 0 1 0 0 0 1

Both ideas lead to the same result. Fine. The third idea: Use Performer:

matrix.preTrans(2, 3, 4, matrix)
for(i=0; i<3; i++)
{
   matrix.getRow(i, &x, &y, &z, &m);
   printf("%d %d %d %d \n", x, y, z, m);
}

This gives me the result:

a b c d
e f g h
i j k l
2 3 4 1

What's wrong here? This isn't correct, is it? I have no idea what's
going on here :-(

Thomas


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Nov 08 2001 - 11:50:40 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.