I know about the Kramer's rule (and have that working), the Gaussian method, and know that the inverse of a rotational 3x3 matrix is it's transpose. But I think I'm missing something. Since the matrix is orthogonal and I can calculate the 3x3 part of it by transposing it, shouldn't there be some easier method to calculate the remaining 3 numbers (the translate part)? I heard somewhere that they should be flipped from positive to negative, but that's not quite working. What am I missing?
Here's an example... I have this matrix:
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
X: 0.819300 -0.196000 0.538800 -0.591540
Y: 0.301200 0.946800 -0.113700 -1.476260
Z: -0.487900 0.255500 0.834700 -0.163410
W: 0.000000 0.000000 0.000000 1.000000
Using the Kramer's rule, the inverse of it is:
X: 0.819302 0.301249 -0.487825 0.849656
Y: -0.195927 0.946701 0.255428 1.323417
Z: 0.538872 -0.113697 0.834705 0.287318
W: 0.000000 0.000000 0.000000 1.000000
But the center can be found by simply transposing the 3x3 part:
X: 0.819300 0.301200 -0.487900 -0.591540
Y: -0.196000 0.946800 0.255500 -1.476260
Z: 0.538800 -0.113700 0.834700 -0.163410
W: 0.000000 0.000000 0.000000 1.000000
So the question is, how to calculate the m[12], m[13] and m[14] quickly? I suppose simply taking a part of the code from Kramer's rule for those 3 would do it, but that's cheap... Does anyone know a better way?