Skip to main content
GameDev.net gamedev.net
🔒 Locked

matrix handedness

Started by jtech Jul 18, 2002 at 10:39 PM 4 replies 8.1k views
Original Post
jtech
jtech
This is more of a math question, so I''ll post it here: How would you test the handedness of a matrix? Can you tell if a 3x3 rotation matrix, for example, is left-handed or right-handed?
TangentZ
TangentZ
Negative. Matrices have no notion of "left-handed" or
"right-handed" associated with them.


~~~~
Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
grhodes_at_work
grhodes_at_work
Actually, I think there is a real answer here. If the matrix is a rotation matrix, there is an implicit "handedness" of the coordinate system represented by the matrix and you can determine it. Lets assume the following:

1) the matrix is a 3x3 rotation matrix; and
2) the columns of the matrix represent the basis vectors of the rotated coordinate system

Let the basis vectors be:

X = (X.x, X.y, X.z)
Y = (Y.x, Y.y, Y.z)
Z = (Z.x, Z.y, Z.z)

so the matrix is:


[ X.x Y.x Z.x ]
M = | X.y Y.y Z.y ]
[ X.z Y.z Z.z ]


Then, you can determine the handedness of the coordinate system with the following pseudocode:


if (Z == (X cross Y) )
system is right-handed
else
system is left-handed
endif


I will note, however, that tangentz is correct in saying "Matrices have no notion of left-handed or right-handed associated with them." It is only in the context of a rotation matrix that you can say the coordinate system represented by the matrix is left- or right-handed.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

[edited by - grhodes_at_work on July 19, 2002 12:11:55 PM]
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
TangentZ
TangentZ
I agree that you can test the "handedness" of a coordinate
system given the basis {v1, v2, v3}.

if (v1 x v2) . v3 > 0, then it''s right-handed.
if (v1 x v2) . v3 < 0, then it''s left-handed.

However, the rotation matrix ITSELF has no notion of "handedness".
Since it is orthogonal (orthonormal), it preserves lengths
and angles, hence the coordinate system. That''s all.

The most you can say about a rotation matrix is whether it
is a reflection (determinant is -1) which reverses "handedness"
or a rotation (determinant is 1) which preserves "handedness".

Please feel free to correct any mistakes I made.


~~~~
Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
jtech
jtech
Thanks to all. That answered my question.
grhodes_at_work
grhodes_at_work
quote:
Original post by tangentz
I agree that you can test the "handedness" of a coordinate
system given the basis {v1, v2, v3}.

if (v1 x v2) . v3 > 0, then it''s right-handed.
if (v1 x v2) . v3 < 0, then it''s left-handed.

However, the rotation matrix ITSELF has no notion of "handedness".
Since it is orthogonal (orthonormal), it preserves lengths
and angles, hence the coordinate system. That''s all.

The most you can say about a rotation matrix is whether it
is a reflection (determinant is -1) which reverses "handedness"
or a rotation (determinant is 1) which preserves "handedness".

Please feel free to correct any mistakes I made.


~~~~
Kami no Itte ga ore ni zettai naru!


tangentz, you''re absolutely correct, .


Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.