#### Archived

This topic is now archived and is closed to further replies.

# Matrix error correction

This topic is 6826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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

1. 1
Rutin
65
2. 2
3. 3
4. 4
5. 5

• 18
• 10
• 30
• 20
• 9
• ### Forum Statistics

• Total Topics
633416
• Total Posts
3011771
• ### Who's Online (See full list)

There are no registered users currently online

×