Conversion of Left-Handed Coordinates to
Right-Handed Coordinates
David Eberly
Geometric Tools, LLC
http://www.geometrictools.com/
Copyright c 1998-2012. All Rights Reserved.
Created: December 20, 2003
Last Modified: March 1, 2008
Contents
1 Right-Handed Coordinate Systems
2 Left-Handed Coordinate Systems
2.1 Heading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Pitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4 Order of Rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Conversion from Left-Handedness to Right-Handedness
3.1 Conversion of Points and Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Conversion of Rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Conversion of Affine Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4 Conversion of Cameras and Lights
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
3
4
5
6
7
7
7
8
10
10
1
This document describes the process by which you convert data in a left-handed coordinate system to
that in a right-handed coordinate system. The data includes vertex locations, translational and rotational
transformations, camera location and orientation, and light location and orientation.
1 Right-Handed Coordinate Systems
A right-handed coordinate system is described as +Xr in the left direction, +Yr in the up direction, and +Zr
in the view direction. Figure 1.1 shows a typical representation.
Figure 1.1 A right-handed coordinate system. The coordinate names are subscripted with r to
stress the fact these are for the right-handed system. The +Zr axis is intend to have direction into
the plane of the page.
The origin of the system is (0, 0, 0). A point (x, y, z) is located relative to the origin by moving x units to
the left (when x > 0) or to the right (when x < 0), y units up (when y > 0) or down (when y < 0), and z
units away (when z > 0) or towards (when z < 0).
The placement of the axes in Figure 1.1 is based on wanting the Yr-axis to point upward and the Zr-axis to
point into the plane of the page. To make sure the coordinate system is right-handed, the only choice for
the Xr-axis is to point to the left. The direction of Xr is actually not relevant on its own. You may choose
Xr to point to the right, Yr to point up, and Zr to point out of the plane of the page. Or choose Xr to point
to the right, Yr to point down, and Zr to point into the plane of the page. For that matter, you may rotate
any of these configurations to any other configuration you like, but you still have a right-handed system.
Choose any of the coordinate directions you wish to be the up vector, choose any remaining direction to be
the view direction. You have only one choice for the third vector. If this is the world coordinate system you
are choosing for an application, you need only position and orient the camera in such a way that your view
of the world is what you expect! You can do this regardless of your convention for what is the up direction
and what is the view direction.
In this document, the rotation conventions for right-handed coordinates are that positive angles are associated
with counterclockwise rotations when viewing the system along the negative direction of the axis of rotation.
The rotation about the x-axis is
(1)
1
0
Rx(θ) =
0
0
cos(θ) − sin(θ)
cos(θ)
sin(θ)
2
0
The rotation about the y-axis is
The rotation about the z-axis is
Ry(θ) =
Rz(θ) =
0
1
0
0
− sin(θ)
cos(θ)
cos(θ) − sin(θ)
cos(θ)
sin(θ)
0
0
sin(θ)
cos(θ)
0
0
0
1
(2)
(3)
2 Left-Handed Coordinate Systems
A left-handed coordinate system is described as +X in the right direction, +Y in the up direction, and +Z
in the view direction. The prototypical modeling package that uses left-handed coordinates for all objects is
LightWave. The discussion here is effectively a description of LightWave’s conventions. Figure 2.1 shows a
typical representation.
Figure 2.1 A left-handed coordinate system. The coordinate names are subscripted with to stress
the fact these are for the left-handed system. The +Z axis is intend to have direction into the plane
of the page.
The origin of the system is (0, 0, 0). A point (x, y, z) is located relative to the origin by moving x units to
the right (when x > 0) or to the left (when x < 0), y units up (when y > 0) or down (when y < 0), and z
units away (when z > 0) or towards (when z < 0).
Figure 2.1 also shows how coordinate axis rotations are defined in this left-handed system. The direction of
the X axis is (1, 0, 0), the direction of the Y axis is (0, 1, 0), and the direction of the Z axis is (0, 0, 1). We
may conveniently store the direction vectors as the columns of the identity matrix,
1
0
0
I =
0
1
0
0
0
1
3
Notice that the first column is the right direction, the second column is the up direction, and the third
column is the view direction.
2.1 Heading
A rotation about the Y-axis represents heading. In Figure 2.1, the direction shown by the arrow labeled
If you are looking in the −Y direction, a positive angle is
“heading” corresponds to a positive angle.
associated with a clockwise rotation. Figure 2.2 shows a view in the −Y direction.
Figure 2.2 A view in the −Y direction. A positive angle for heading is associated with a clockwise
rotation in the plane of X and Z.
The heading angle is θh and the figure illustrates a heading that is a positive angle (clockwise rotation).
The Z axis is rotated to the Z
axis, the latter axis having direction (sh, 0, ch) where sh = sin(θh) and
axis, the latter axis having direction (ch, 0,−sh). The Y
ch = cos(θh). The X axis is rotated to the X
axis is unchanged by the rotation, so the rotated axis Y
is the same as the original one. Just as the identity
matrix columns are the original directions in the order right, up, and view, the rotated axes may be listed
as the columns of another matrix in the same order. This matrix is the heading matrix
ch
0
sh
H(θh) =
0
1
0
−sh
Observe that the first column is the direction of the X
(and Y) axis, and the third column is the direction of the Z
The heading matrix was introduced as a convenient way to store the directions of the rotated coordinate
axes. The matrix has double duty in that it may also be used to show how points (x, y, z) in the original
coordinate system are rotated to points (x, y, z). Specifically,
axis, the second column is the direction of the Y
axis.
ch
0
x
y
z
=
ch
0
−sh
0
1
0
sh
0
ch
x
y
z
=
chx + shz
−shx + chz
y
(4)
The standard rules of matrix multiplication have been applied.
4
2.2 Pitch
A rotation about the X axis represents pitch. In Figure 2.1, the direction shown by the arrow labeled “pitch”
corresponds to a positive angle. If you are looking in the −X direction, a positive angle is associated with
a clockwise rotation. Figure 2.3 shows a view in the −X direction.
Figure 2.3 A view in the −X direction. A positive angle for heading is associated with a clockwise
rotation in the plane of Y and Z.
The pitch angle is θp and the figure illustrates a pitch that is a positive angle (clockwise rotation). The Z
axis, the latter axis having direction (0,−sp, cp) where sp = sin(θp) and cp = cos(θp).
axis is rotated to the Z
The Y axis is rotated to the Y
axis, the latter axis having direction (0, cp, sp). The X axis is unchanged
by the rotation, so the rotated axis X
is the same as the original one. Just as the identity matrix columns
are the original directions in the order right, up, and view, the rotated axes may be listed as the columns of
another matrix in the same order. This matrix is the pitch matrix
1
0
0
0
cp −sp
cp
sp
P(θp) =
0
Observe that the first column is the direction of the X
the Y
axis, and the third column is the direction of the Z
axis.
(and X) axis, the second column is the direction of
The pitch matrix was introduced as a convenient way to store the directions of the rotated coordinate axes.
The matrix has double duty in that it may also be used to show how points (x, y, z) in the original coordinate
system are rotated to points (x, y, z). Specifically,
x
y
z
=
1
0
0
x
y
z
=
0
0
cp −sp
cp
sp
x
cpy − spz
spy + cpz
(5)
The standard rules of matrix multiplication have been applied.
5
2.3 Bank
A rotation about the Z axis represents bank. In Figure 2.1, the direction shown by the arrow labeled “bank”
corresponds to a positive angle. If you are looking in the −Z direction, a positive angle is associated with
a clockwise rotation. Figure 2.4 shows a view in the −Z direction.
Figure 2.4 A view in the −Z direction. A positive angle for heading is associated with a clockwise
rotation in the plane of X and Y.
The bank angle is θb and the figure illustrates a bank that is a positive angle (clockwise rotation). The X
axis is rotated to the X
axis, the latter axis having direction (cb, sb, 0) where sb = sin(θb) and cb = cos(θb).
axis, the latter axis having direction (−sb, cb, 0). The Z axis is unchanged
The Y axis is rotated to the Y
by the rotation, so the rotated axis Z
is the same as the original one. Just as the identity matrix columns
are the original directions in the order right, up, and view, the rotated axes may be listed as the columns of
another matrix in the same order. This matrix is the bank matrix
cb −sb
sb
cb
0
0
0
1
B(θb) =
0
Observe that the first column is the direction of the X
axis, and the third column is the direction of the Z
(and Z) axis.
axis, the second column is the direction of the Y
The bank matrix was introduced as a convenient way to store the directions of the rotated coordinate axes.
The matrix has double duty in that it may also be used to show how points (x, y, z) in the original coordinate
system are rotated to points (x, y, z). Specifically,
x
y
z
=
cb −sb
sb
cb
0
0
x
y
z
0
0
1
=
cbx − sby
sbx + cby
z
(6)
The standard rules of matrix multiplication have been applied.
6
2.4 Order of Rotations
The order of application of heading, pitch, and bank is dependent on the graphics package at hand. Light-
Wave specifies rotations only by a composition of coordinate axis rotations. Moreover, LightWave only tells
you the three angles: heading, pitch, and bank. It is important that you apply these in the correct order. In
particular, the composite rotation is R = HPB. LightWave uses the convention for transforming vectors,
Rv, where the vector v is a 3 × 1 column vector. Thus, LightWave applies bank first, pitch second, and
heading third.
3 Conversion from Left-Handedness to Right-Handedness
The simplest method for conversion is to flip the direction of one of the axes of the left-handed system. It
does not matter which one. The analysis here uses the flip of the z-axis direction. You may also flip the
direction of all three axes, but no sense in doing more work than you have to.
3.1 Conversion of Points and Translations
This is where the flip of the z-axis direction is obvious. A point (x, y, z) in the left-handed system is converted
to a point (x, y,−z) in the right-handed system. Figure 3.1 illustrates this in the xz-plane with the two
coordinate systems superimposed.
Figure 3.1 Conversion of a point in left-handed coordinates (subscripted with an ) to a point in
right-handed (subscripted with a r). Just change sign on the z-component.
The figure shows that the point in the left-handed coordinate system has a positive z component. In the
right-handed coordinate system, observe that the z component must be negative. In matrix-vector form, the
conversion from a left-handed point Q to a right-handed point Qr is
x
y
−z
=
1
0
0
Qr =
x
y
z
= SzQ
0
0
1
0
0 −1
7
where Sz is defined to be the diagonal matrix
Sz = Diag(1, 1,−1) =
1
0
0
0
0
1
0
0 −1
The translational component of a transformation is modified just as points are. The z component is negated.
Pseudocode for conversion of a point (or translation) is
Vector3 LH_Point(LH_X, LH_Y,
LH_Z);
Vector3 RH_Point(LH_X, LH_Y, -LH_Z);
// left-handed coordinates of point
// right-handed coordinates of point
3.2 Conversion of Rotations
Conversion of Heading. Equation 4 shows that an input left-handed point Q = (x, y, z) is transformed
by the heading matrix to an output left-handed point Q
= (x, y, z) by
x
y
z
=
ch
0
−sh
Q
=
x
y
z
= HQ
0
1
0
sh
0
ch
In right-handed coordinates, both the input and output must have negated z components, so the transfor-
mation in the right-handed system is Qr = (x, y,−z) → (x, y,−z) = Q
r, or
r = SzQ
Q
= SzHQ = (SzHSz)Qr
The heading matrix Hr in the right-handed system corresponding to the heading matrix H in the left-handed
system is
(7)
For a matrix M = [mij] with 0 ≤ i ≤ 2 and 0 ≤ j ≤ 2, the operation SzM Sz is equivalent to changing the
signs on m02, m12, m20, and m21.
Hr = SzHSz
Conversion of Pitch. Equation 5 shows that an input left-handed point Q = (x, y, z) is transformed by
the pitch matrix to an output left-handed point Q
= (x, y, z) by
x
y
z
=
1
0
0
Q
=
x
y
z
= PQ
0
0
cp −sp
cp
sp
In right-handed coordinates, both the input and output must have negated z components, so the transfor-
mation in the right-handed system is Qr = (x, y,−z) → (x, y,−z) = Q
r, or
Q
r = SzQ
= SzPQ = (SzPSz)Qr
8