FireMonkey opened this issue on Oct 19, 2006 ยท 19 posts
kuroyume0161 posted Thu, 19 October 2006 at 12:58 PM
Quote - kuroyume: I would love the info on converting right-handed matrix to left-handed, I have some idea of it but mostly I'm making educated guesses based on what I see in various CR2s I have looked at.
Remember that this is changing a right-handed coordinate system into a left-handed coordinate system (in my case, I do this from Poser (right) to Cinema 4D (left)).
The matrix math is pretty straight forward (post-multiplication):
Matrix lhm = reflect * transpose * rhm
In words, the right-handed matrix is transposed and then multipled by a reflection matrix (about the z-axis).
Transposing the matrix involves a sort-of diagonal flip of the 4x4 matrix:
Right-handed (row-vector representation):
v1.x, v1.y, v1.y, 0
v2.x, v2.y, v2.z, 0
v3.x, v3.y, v3.z, 0
t.x, t.y, t.z, 1
becomes Left-handed (column-vector representation):
v1.x, v2.x, v3.x, t.x
v1.y, v2.y, v3.y, ty
v1.z, v2.z, v3.z, tz
0, 0, 0, 1
The left-handed reflection matrix is then:
1, 0, 0, 0
0, 1, 0, 0
0, 0, -1, 0
0, 0, 0, 1
The -1 reflects rotations and translations from the one system to the other (about the z-axis - x-y plane).
C makes it easy to shoot yourself in the
foot. C++ makes it harder, but when you do, you blow your whole leg
off.
-- Bjarne
Stroustrup
Contact Me | Kuroyume's DevelopmentZone