Graphics Reference
In-Depth Information
3.2.2 Transformations Composition
Local TRS uniquely defines a local transformation matrix M . We transform
vector v in the following way:
v = v SR + T = v SRT = v M ,
(3.1)
where S is an arbitrary scale matrix, R is an arbitrary rotation matrix, T is a
translation matrix, and T is the vector matrix T is made of. 2
To render an object, we need to obtain its global (world) transformation by
composing local transformations of all the object's ancestors up in the hierarchy.
The composition is achieved by simply multiplying local matrices. Given a
vector v 0 , its local matrix M 0 , and the local matrix M 1 of v 0 's parent, we can
find the global position v 2 :
v 2 = v 1 M 1 = v 0 M 0 M 1 .
Using vector notation for translation, we get
v 2 = v 1 S 1 R 1 + T 1 =( v 0 S 0 R 0 + T 0 ) S 1 R 1 + T 1
(3.2)
= v 0 ( S 0 R 0 S 1 R 1 )+( T 0 S 1 R 1 + T 1 )
Given that we store local transformations in TRS, it would be useful if we could
decompose the global M 0 M 1 matrix into TRS. We can easily extract the transla-
tion vector T 0 S 1 R 1 + T 1 but scale and rotation S 0 R 0 S 1 R 1 is somehow combined.
It turns out that in the general case we cannot extract the S and R matrices out
of the S 0 R 0 S 1 R 1 matrix. It stems from the following theorem.
Theorem 3.1. There exist a rotation matrix R andascalematrix S such that RS
cannot be expressed in the form of S R ,where S is a scale matrix and R is a
rotation matrix.
Proof: Consider
10 0
0
100
020
001
2
2
2
2
,
S =
R =
.
2
2
2
2
0
Let us suppose by contradiction that there exist a scale matrix S and a
rotation matrix R such that RS = S R .Moreover,
s 1 00
0 s 2 0
00 s 3
r 11 r 12 r 13
r 21 r 22 r 23
r 31 r 32 r 33
,
.
S =
R =
2 In expression v SR + T terms S and R are 3 × 3 matrices and T is a 3-component vector.
In v SRT all S , R and T terms are 4 × 4 matrices.
Search WWH ::




Custom Search