Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block...
Transcript of Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block...
![Page 1: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/1.jpg)
Graphics (INFOGR), 2017-18, Block IV, lecture 9
Deb Panja
Today: Matrix reloaded 1(aka Transformations)
Welcome
1
![Page 2: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/2.jpg)
Remember...
2
![Page 3: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/3.jpg)
Remember...
• Operations defined: they can transform vectors!
− use them to project, scale, reflect, shear, rotate.... objects(objects means objects one point at a time)
• Point transformations: P → P ′ (also, active transformations)
[point (x, y, z) represented as vector
xyz
drawn from the origin]
3
![Page 4: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/4.jpg)
That brings us to... active vs. passive transformations
4
![Page 5: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/5.jpg)
That brings us to... active vs. passive transformations
point transformation co-ordinate transformation
(aka active transformation) (aka passive transformation)
5
![Page 6: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/6.jpg)
Today
• Point, or active transformations
− translation
− projection
− reflection
− scaling
− shearing
− rotation
− linear transformation properties
− combining transformations (and transformation back!)
• Co-ordinate, or passive transformations
• Will largely work in terms of symbols
6
![Page 7: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/7.jpg)
Point, or active transformations
7
![Page 8: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/8.jpg)
Translation
8
![Page 9: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/9.jpg)
Translation: a matrix operation?
• We translate a point P (x, y, z) by (ax, ay, az)
i.e., x′ = x+ ax, y′ = y + ay, z
′ = z + az
Q. How do we express this transformation as a matrix operation?
[think of using (x, y, z) as a vector ~v from the origin]
9
![Page 10: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/10.jpg)
Translation: a matrix operation
• We translate a point P (x, y, z) by (ax, ay, az)
i.e., x′ = x+ ax, y′ = y + ay, z
′ = z + az
A.
x′
y′
z′
1
=
1 0 0 ax0 1 0 ay0 0 1 az0 0 0 1
︸ ︷︷ ︸
Mt(~a)
xyz1
; ~a =
axayaz
10
![Page 11: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/11.jpg)
Translation: a matrix operation
• We translate a point P (x, y, z) by (ax, ay, az)
i.e., x′ = x+ ax, y′ = y + ay, z
′ = z + az
A.
x′
y′
z′
1
︸ ︷︷ ︸
~wt
=
1 0 0 ax0 1 0 ay0 0 1 az0 0 0 1
︸ ︷︷ ︸
Mt(~a)
xyz1
︸ ︷︷ ︸extendedvector
; ~a =
axayaz
• From now on, will use the extended vector to reach P from the origini.e., we add a fictitious dimension, meaning:
x =
1000
, y =
0100
, z =
0010
, f =
0001
11
![Page 12: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/12.jpg)
How to think about an extended vector for 2D
• Note: A “real” vector ~v, by construction, satisfies ~v · f = 0
e.g., the (2+1)D representation of a real vector in 2D is
vxvy0
12
![Page 13: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/13.jpg)
Projection
13
![Page 14: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/14.jpg)
Projecting a 2D object on the x-axis: matrix operation?
14
![Page 15: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/15.jpg)
Projecting a 2D object on the x-axis: a matrix operation
x01
=
1 0 00 0 00 0 1
xy1
15
![Page 16: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/16.jpg)
Projecting a 2D object on the x-axis: a matrix operation
x01
=
1 0 00 0 00 0 1
︸ ︷︷ ︸
Mp
xy1
16
![Page 17: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/17.jpg)
Projecting a 2D object on the x-axis: a matrix operation
x01
=
1 0 00 0 00 0 1
︸ ︷︷ ︸
Mp
xy1
︸ ︷︷ ︸
~v
=
~v · x01
17
![Page 18: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/18.jpg)
Projecting a 2D object on the x-axis: a matrix operation
x01
︸ ︷︷ ︸
~wp
=
1 0 00 0 00 0 1
︸ ︷︷ ︸
Mp
xy1
︸ ︷︷ ︸
~v
=
~v · x01
Note: ~wp = ~v − (~v · y)y
18
![Page 19: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/19.jpg)
Projecting a 2D object on the x-axis: a matrix operation
x01
︸ ︷︷ ︸
~wp
=
1 0 00 0 00 0 1
︸ ︷︷ ︸
Mp
xy1
︸ ︷︷ ︸
~v
=
~v · x01
Note: ~wp = ~v − (~v · y) y; i.e., ~wp =
~wp · x~wp · y~wp · f
=
~v · x01
19
![Page 20: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/20.jpg)
Projecting an object: a matrix operation
~wp = ~v−(~v · n) n; for d = 3, ~wp =
~wp · x~wp · y~wp · z~wp · f
=
~v · x− (~v · n)(n · x)~v · y − (~v · n)(n · y)~v · z − (~v · n)(n · z)
~v · f
(remember: n · f = 0; i.e., n = nxx+ nyy + nzz); nx = n · x etc.
Q. What is Mp?
20
![Page 21: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/21.jpg)
Projecting an object: a matrix operation
~wp = ~v−(~v · n) n; for d = 3, ~wp =
~wp · x~wp · y~wp · z~wp · f
=
~v · x− (~v · n)(n · x)~v · y − (~v · n)(n · y)~v · z − (~v · n)(n · z)
~v · f
A. Mp =
1− n2
x −nxny −nxnz 0−nxny 1− n2
y −nynz 0−nxnz −nynz 1− n2
z 00 0 0 1
21
![Page 22: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/22.jpg)
Reflection
22
![Page 23: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/23.jpg)
Reflecting an object: a matrix operation
Q. ~wr?
23
![Page 24: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/24.jpg)
Reflecting an object: a matrix operation
A. ~wr = ~v − 2(~v · n)n; for d = 3, ~wr =
~v · x− 2(~v · n)(n · x)~v · y − 2(~v · n)(n · y)~v · z − 2(~v · n)(n · z)
~v · f
~wr = Mr~v; Mr =
1− 2n2
x −2nxny −2nxnz 0−2nxny 1− 2n2
y −2nynz 0−2nxnz −2nynz 1− 2n2
z 00 0 0 1
24
![Page 25: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/25.jpg)
Reflecting a vector: a matrix operation
Q. ~vr?
25
![Page 26: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/26.jpg)
Reflecting a vector: a matrix operation
A. ~vr = ~v − 2(~v · n)n; e.g. d = 3, ~vr =
~v · x− 2(~v · n)(n · x)~v · y − 2(~v · n)(n · y)~v · z − 2(~v · n)(n · z)
0
= Mr~v
26
![Page 27: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/27.jpg)
Scaling
27
![Page 28: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/28.jpg)
Scaling: a matrix operation
• d = 2:
x′
y′
1
=
sx 0 00 sy 00 0 1
︸ ︷︷ ︸
Msc(~s)
xy1
; uniform scaling: sx = sy
s =
[sxsy
]
28
![Page 29: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/29.jpg)
Scaling: a matrix operation
• d = 2:
x′
y′
1
=
sx 0 00 sy 00 0 1
︸ ︷︷ ︸
Msc(~s)
xy1
; uniform scaling: sx = sy
• d = 3:
x′
y′
z′
1
=
sx 0 0 00 sy 0 00 0 sz 00 0 0 1
xyz1
; uniform scaling: sx=sy=sz
• . . .
29
![Page 30: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/30.jpg)
Shearing
30
![Page 31: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/31.jpg)
Shearing: a matrix operation
x′
y′
1
=
1 b 00 1 00 0 1
︸ ︷︷ ︸
Msh(b)
xy1
x′
y′
1
=
1 0 0b 1 00 0 1
xy1
31
![Page 32: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/32.jpg)
Rotation
32
![Page 33: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/33.jpg)
Rotation: a matrix operation [with Mro(θ)]
33
![Page 34: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/34.jpg)
Rotation: a matrix operation [with Mro(θ)]
34
![Page 35: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/35.jpg)
Linear (point) transformations
35
![Page 36: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/36.jpg)
Linear (point) transformations
• Point (x1, x2, . . . , xd) represented as a vector ~v drawn from the origin
• Linear point transformations satisfy the two following criteria:
(a) T (~v1 + ~v2) = T (~v1) + T (~v2)
(b) T (α~v) = αT (~v)
• Examples: translation, projection, reflection, . . .
36
![Page 37: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/37.jpg)
Linear (point) transformations
• Point (x1, x2, . . . , xd) represented as a vector ~v drawn from the origin
• Linear point transformations satisfy the two following criteria:
(a) T (~v1 + ~v2) = T (~v1) + T (~v2)
(b) T (α~v) = αT (~v)
• Examples: translation, projection, reflection, . . .
• Now you can see why this constitutes linear algebra:
− points/lines/(hyper)planes → points/lines/(hyper)planes
(also known as affine transformation)
37
![Page 38: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/38.jpg)
Combining transformations
38
![Page 39: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/39.jpg)
Rule for combining transformations
• Two transformations: e.g., first scale and then rotate
39
![Page 40: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/40.jpg)
Rule for combining transformations
• Two transformations: e.g., first scale︸ ︷︷ ︸transformationmatrixMsc
and then rotate︸ ︷︷ ︸transformationmatrixMro
(x, y, z)→ (x′′, y′′, z′′)
Q. How do we express this as a matrix operation?
40
![Page 41: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/41.jpg)
Rule for combining transformations
• Two transformations: e.g., first scale︸ ︷︷ ︸transformationmatrixMsc
and then rotate︸ ︷︷ ︸transformationmatrixMro
(x, y, z)→ (x′′, y′′, z′′)
Q. How do we express this as a matrix operation?
Hint: (x, y, z)→ (x′, y′, z′)→ (x′′, y′′, z′′)
41
![Page 42: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/42.jpg)
Rule for combining transformations
• Two transformations: e.g., first scale︸ ︷︷ ︸transformationmatrixMsc
and then rotate︸ ︷︷ ︸transformationmatrixMro
(x, y, z)→ (x′′, y′′, z′′)
Q. How do we express this as a matrix operation?
A. (x, y, z) →︸︷︷︸Msc
(x′, y′, z′) →︸︷︷︸Mro
(x′′, y′′, z′′)
42
![Page 43: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/43.jpg)
Rule for combining transformations
• Two transformations: e.g., first scale︸ ︷︷ ︸transformationmatrixMsc
and then rotate︸ ︷︷ ︸transformationmatrixMro
(x, y, z)→ (x′′, y′′, z′′)
Q. How do we express this as a matrix operation?
A. (x, y, z) →︸︷︷︸Msc
(x′, y′, z′) →︸︷︷︸Mro
(x′′, y′′, z′′)
Q′. (x, y, z) →︸︷︷︸M
(x′′, y′′, z′′). Is M = MscMro or M = MroMsc?
43
![Page 44: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/44.jpg)
Rule for combining transformations
• Two transformations: e.g., first scale︸ ︷︷ ︸transformationmatrixMsc
and then rotate︸ ︷︷ ︸transformationmatrixMro
(x, y, z)→ (x′′, y′′, z′′)
Q. How do we express this as a matrix operation?
A. (x, y, z) →︸︷︷︸Msc
(x′, y′, z′) →︸︷︷︸Mro
(x′′, y′′, z′′)
Q′. (x, y, z) →︸︷︷︸M
(x′′, y′′, z′′). Is M = MscMro or M = MroMsc?
A′. M = MroMsc (order important!)
Remember: for matrices AB is not necessarily = BA!
(e.g., y-rotation after x-rotation 6≡ x-rotation after y-rotation)
44
![Page 45: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/45.jpg)
Transforming back
45
![Page 46: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/46.jpg)
Transforming back
• So far, (x, y, z) →︸︷︷︸M
(x′, y′, z′)
now we want (x′, y′, z′) →︸︷︷︸M ′
(x, y, z)
Q. Given M , how do we calculate M ′?
46
![Page 47: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/47.jpg)
Transforming back
• So far, (x, y, z) →︸︷︷︸M
(x′, y′, z′)
now we want (x′, y′, z′) →︸︷︷︸M ′
(x, y, z)
Q. Given M , how do we calculate M ′?
A. M ′ = M−1
47
![Page 48: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/48.jpg)
Transforming back
• So far, (x, y, z) →︸︷︷︸M
(x′, y′, z′)
now we want (x′, y′, z′) →︸︷︷︸M ′
(x, y, z)
Q. Given M , how do we calculate M ′?
A. M ′ = M−1
• Sometimes the inverse may not exist (e.g., for projection)
in that case, M is?
48
![Page 49: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/49.jpg)
Transforming back
• So far, (x, y, z) →︸︷︷︸M
(x′, y′, z′)
now we want (x′, y′, z′) →︸︷︷︸M ′
(x, y, z)
Q. Given M , how do we calculate M ′?
A. M ′ = M−1
• Sometimes the inverse may not exist (e.g., for projection)
in that case, M is a singular matrix
49
![Page 50: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/50.jpg)
Transforming back, and rotation matrices
• So far, (x, y, z) →︸︷︷︸M
(x′, y′, z′)
now we want (x′, y′, z′) →︸︷︷︸M ′
(x, y, z)
Q. Given M , how do we calculate M ′?
A. M ′ = M−1
• Sometimes the inverse may not exist (e.g., for projection)
in that case, M is a singular matrix
• Inverse calculation is expensive (cofactors, determinants...)
it is however cheap for rotation matrices, since MroMTro = MT
roMro,
i.e., simply M−1ro = MTro
50
![Page 51: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/51.jpg)
Transforming back, and rotation matrices
• So far, (x, y, z) →︸︷︷︸M
(x′, y′, z′)
now we want (x′, y′, z′) →︸︷︷︸M ′
(x, y, z)
Q. Given M , how do we calculate M ′?
A. M ′ = M−1
• Sometimes the inverse may not exist (e.g., for projection)
in that case, M is a singular matrix
• Inverse calculation is expensive (cofactors, determinants...)
it is however cheap for rotation matrices, since MroMTro = MT
roMro,
i.e., simply M−1ro = MTro; note: M−1ro (θ) = MT
ro(θ) = Mro(−θ)
51
![Page 52: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/52.jpg)
Co-ordinate, or passive transformations
52
![Page 53: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/53.jpg)
Active vs. passive transformations (with rotation)
point transformation co-ordinate transformation
(aka active transformation) (aka passive transformation)
• Co-ordinate 2 is anti-clockwise rotated (θ) wrt co-ordinate 1
means (x1, y1, z1) →︸︷︷︸Mro(−θ)
(x2, y2, z2) describes the same physical point
53
![Page 54: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/54.jpg)
Active vs. passive transformations: translation
• Co-ordinate 2 is translated (~a) wrt co-ordinate 1
means (x1, y1, z1) →︸︷︷︸Mt(−~a)
(x2, y2, z2) describes the same physical point
54
![Page 55: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/55.jpg)
Active vs. passive transformations: translation and scaling
• Co-ordinate 2 is translated (~a) wrt co-ordinate 1
means (x1, y1, z1) →︸︷︷︸Mt(−~a)
(x2, y2, z2) describes the same physical point
• Co-ordinate 2 is scaled (~s) wrt co-ordinate 1
means (x1, y1, z1) →︸︷︷︸Msc(
−→1/s)
(x2, y2, z2) describes the same physical point
55
![Page 56: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/56.jpg)
Summary
• Point, or active transformations
− translation
− projection
− reflection
− scaling
− shearing
− rotation
− linear transformation properties
− combining transformations (and transformation back!)
• Co-ordinate, or passive transformations
• Next class: viewing transformations
56
![Page 57: Today: Matrix reloaded 1 (aka Transformations) · 2018. 6. 5. · Graphics (INFOGR), 2017-18, Block IV, lecture 9 Deb Panja Today: Matrix reloaded 1 (aka Transformations) Welcome](https://reader035.fdocuments.us/reader035/viewer/2022070212/6104b722e50f2c040218df0d/html5/thumbnails/57.jpg)
Finally, references...
• Book chapter 6: Transformation matrices (can leave out Sec. 6.5)
57