CVF07 Lec05-06
CVF07 Lec05-06
CVF07 Lec05-06
3D Translation
Point in 3D given by (X1 Y1 Z1)
Translated by (dx dy dz)
X2 = X1 + dx
Y2 = Y1 + dy
Z2 = Z1 + dz
Translation
In matrix form
X 2 1 0 0 dx X 1
Y 0 1 0 dy Y1
2=
Z 2 0 0 1 dz Z1
1 0 0 0 1 1
Inverse Transformation
1 0 0 dx 1 0 0 − dx
0 1 0 dy 0 1 0 − dy
T= T −1 =
0 0 1 dz 0 0 1 − dz
0 0 0 1 0 0 0 1
T T-1 = I
Scaling
Point in 3D given by (X1 Y1 Z1)
Scaled by (Sx Sy Sz)
X2 = X1 * Sx
Y2 = Y1 * Sy
Z2 = Z1 * Sz
Scaling
In matrix form
X 2 Sx 0 0 0 X 1
Y 0 Sy 0 0 Y
2= 1
Z 2 0 0 Sz 0 Z1
1 0 0 0 1 1
S
Inverse Transformation
1
Sx 0 0 0 Sx 0 0 0
0 Sy 0 0 1
S= 0
S −1 =
0 0
0 0 Sz 0 Sy
1
0 0 0 1 0 0 0
0 Sz
0 0 1
S S-1 = I
Shearing
What will these do?
1 e 0 0 1 0 e 0 1 d e 0 1 d 0 0
0 1 0 0 0 1 0 0 0 1 0 0 e 1 0 0
0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
3D Rotation
Y
Rotation about Z-axis (x2 y2 z2)
Z-coordinate will not
change
Z’ = Z (x1 y1 z1)
θ
If we ignore the Z-
coordinate, it is 2-D
transformation in XY X
plane
X ' cosθ − sin θ 0 0 X
Y ' sin θ cosθ 0 0 Y Z
=
Z ' 0 0 1 0 Z
1 0 0 0 1 1
Rotation
Y
Positive rotation is (x2 y2 z2)
counterclockwise
when looking (x1 y1 z1)
down the axis of θ
rotation towards
origin X
Z
Rotation about Principal Axes
Right hand rule
XYZ is a right
handed system if:
Place your right
wrist at the origin,
curl your fingers
from X to Y, thumb
should point along
+ve Z
X y z
Z x y
X ' = X cosθ − Y sin θ Y ' = Y cosθ − Z sin θ Z ' = Z cosθ − X sin θ
Y ' = X sin θ + Y cosθ Z ' = Y sin θ + Z cosθ X ' = Z sin θ + X cosθ
Z'= Z X '= X Y'= Y
Rotation about Principal Axes
X ' = X cosθ − Y sin θ Y ' = Y cosθ − Z sin θ Z ' = Z cosθ − X sin θ
Y ' = X sin θ + Y cosθ Z ' = Y sin θ + Z cosθ X ' = Z sin θ + X cosθ
Z'= Z X '= X Y'= Y
Rotation about Z Rotation about X Rotation about Y
cosθ − sin θ 0 0 1 0 0 0 cos β 0 sin β 0
sin θ cosθ 0 0 0 cos γ − sin γ 0 0 1 0 0
0 0 1 0 0 sin γ cos γ 0 − sin β 0 cos β 0
0 0 0 1 0 0 0 1 0 0 0 1
Concatenation of Rotations
Rotation around X by γ followed by
rotation around Y by β followed by
rotation around Z by α
Rodrigues’ Formula
Alternate description of a rotation matrix
Assume we want to rotate a vector v about n
by angle θ so that v transforms to v’
n
v'
v
Rodrigues’ Formula
v can be decomposed into two components,
v|| and v⊥
v|| is the component of v parallel to n
v⊥is the component of v perpendicular to n
n v'
n v'
Rodrigues’ Formula
v
v = v|| + v⊥ (Eq 1)
v|| = [projection of v on n]
v|| = (v.n)n
v⊥ from Eq 1
v⊥ = v - (v.n)n
1st component (v||) is invariant under rotation
2nd component (v⊥) will rotate to v’⊥
Rodrigues’ Formula
Claim:
v’⊥= v⊥cosθ + (n x v⊥) sinθ v'
n
n x v⊥
v’⊥
v
θ
n θ
out v⊥
of paper
v’⊥ = (v - (v.n)n) cosθ + n x (v - (v.n)n) sinθ
Rodrigues’ Formula
v’ = v’|| + v’⊥
v’ = (v.n)n +
(v - (v.n)n) cosθ + n x (v - (v.n)n) sinθ
v'
n
θ
v’ = (v.n)n + (v - (v.n)n) cosθ + n x (v - (v.n)n) sinθ
v’ = v cosθ + (n x v) sinθ + (1- cosθ) (v.n)n
v’ = v + (n x v) sinθ + (1- cosθ) (n x (n x v)) [show]
v'
n