Advertisement

Matrix error correction

Started by March 14, 2000 05:08 AM
0 comments, last by Sovereign 24 years, 11 months ago
Hi everybody Does anybody know what the mathematical process or how to correct for matrix drift or errors. I am using a 4x4 linear matrix such as mat[16]. I read diffrent articles on this subject from diffrent websites. The methods mentioned are dot products and normalization, cross products then normalization and finally matrix to quaternion and the quaternion back to matrix. Even though they mention these methods they never seem to show you the steps of correcting a matrix drift or error. Any examples would be greatly appreaciated. Thanks Doug
I'm assuming you're only using rotation and translation. For this setup you only need to error correction to the first 3x3 part of the matrix. This is where the rotation information is stored. I'll tell you one way of error correcting this part:

MATRIX M; // The matrix to be correctedVECTOR E1,E2,E3; // Three temporary vectors// Extract the rotation informationE1 = VECTOR(M[0][0], M[0][1], M[0][2]);E2 = VECTOR(M[1][0], M[1][1], M[1][2]);E3 = VECTOR(M[2][0], M[2][1], M[2][2]);// Make sure the vectors are orthogonal and normalizedE3 = Normalize(Cross(E1, E2)); // Make E3 orthogonal to E1 and E2E2 = Normalize(Cross(E3, E1)); // Make E2 orthogonal to E3 and E1E1 = Normalize(E1);// Reinsert the information into the matrixM[0][0] = E1.x; M[0][1] = E1.y; M[0][2] = E1.z;M[1][0] = E2.x; M[1][1] = E2.y; M[1][2] = E2.z;M[2][0] = E3.x; M[2][1] = E3.y; M[2][2] = E3.z; 


I hope that clears things up. Remember that CrossProduct isn't commutative so you must make you compute these in the correct order otherwise you'll introduce mirroring in the transformation.

Edited by - Spellbound on 3/14/00 10:26:49 AM

This topic is closed to new replies.

Advertisement