04 Transformation 2 D
04 Transformation 2 D
2D Geometric
Transformations
Definition
물체의 좌표를 바꾸는 것
Translation, Rotation, Scaling
Modeling
Coordinates
World Coordinates
Modeling
Coordinates
Scale(0.3, 0.3)
World Coordinates
Modeling
Coordinates
Scale(0.3, 0.3)
Rotate(-90)
World Coordinates
Modeling
Coordinates
Scale(0.3, 0.3)
Rotate(-90)
Translate(5, 3)
World Coordinates
Modeling
Coordinates
Again?
World Coordinates
Modeling
Coordinates
Scale
Translate
Scale
Rotate
Translate
World Coordinates
Translation
x x tx
y y ty
Scale
x x sx
y y sy
Rotation
x x cosθ - y sinθ
y y sinθ y cosθ
Shear
x x hx y
y y hy x
Translation
x x tx
y y ty
Scale
x x sx
y y sy
Rotation
x x cosθ - y sinθ Transformations
y y sinθ y cosθ
can be combined
(with simple algebra)
Shear
x x hx y
y y hy x
Translation
x x tx
y y ty
Scale
x x sx
y y sy
Rotation
x x cosθ - y sinθ
y y sinθ y cosθ
Shear x x sx
x x hx y y y sy
y y hy x
Translation
x x tx
y y ty
Scale
x x sx
y y sy
Rotation
x x cosθ - y sinθ
y y sinθ y cosθ
Shear x ((x sx) cos (y sy) sin )
x x hx y y ((x sx) sin (y sy) cos )
y y hy x
Translation
x x tx
y y ty
Scale
x x sx
y y sy
Rotation
x x cosθ - y sinθ
y y sinθ y cosθ
Shear x ((x sx) cos (y sy) sin ) tx
x x hx y y ((x sx) sin (y sy) cos ) ty
y y hy x
Translation
x x tx
y y ty
Scale
x x sx
y y sy
Rotation
x x cosθ - y sinθ
y y sinθ y cosθ
Shear x ((x sx) cos (y sy) sin ) tx
x x hx y y ((x sx) sin (y sy) cos ) ty
y y hy x
x a b e f i j x
y c d g
h k l y
Transformation
Matrix
Matrices are a convenient and efficient way
to represent a sequence of transformations
x 1 0 tx x
x x tx y 0 1 ty y
y y ty
1 0 0 1 1
Rotate Shear
Projective transformations…
Affine transformations, and
Projective warps x
a
b c x
y d e f y
w g h i w
Properties of projective transformations
Origin does not map to origin
Lines map to lines
Parallel lines do not necessarily remain parallel
Ratios are not preserved
Closed under composition
(a,b)
0 0 1 0 0 1 0 0 1 0 0 1
T x f , y f S s x , s y T x f , y f S x f , y f , s x , s y
1 0 xf sx 0 0 1 0 x f sx 0 x f (1 s x )
0 1 yf 0 sy 0 0 1 y f 0 sy y f (1 s y )
0 0 1 0 0 1 0 0 1 0 0 1
y 1 y y
1 1’ 1’
2 3 2 3 3’ 2 3’ 2
x x 3 x
2’ 3’ 1
1’ 2
x 축에 대한 반사 y 축에 대한 반사 원점에 대한 반사
y
0 1 0
1 0 0
x
0 0 1
y=x 에 대한 반사
Clockwise rotation of 45 Reflection about the x
axis Counterclockwise rotation of 45
y y 1
y
2 3
x 2 3 x
x
’ ’
1
’
Converted to a parallelogram
y (1,1) y
(0,1)
1 sh x 0 (2,1) (3,1)
0 1 0
(0,0) (1,0) x
(0,0) (1,0)
x
0 0 1
x’ = x + shx · y, y’ = y
x 축으로 밀림 (Shx=2)
Transformed to a shifted parallelogram
(Y = Yref)
y y
(1,1) (1,1) (2,1)
1 sh x sh x y ref (0,1)
0 1 (1/2,0)
0 x
(0,0) (1,0) (3/2,0)x
0 0 1
(0,-1)
선분에 대한 밀림
x’ = x + shx · (y-yref), y’ = y
(Shx=1/2, yref=-1)
(0,3/2) (1,2)
1 0 0 y y
sh 1 sh y x ref (1,1)
y (0,1)
0 0 1 (0,1/2) (1,1)
x x
(0,0) (1,0) (-1,0)
x’ = x, y’ = shy · (x-xref) + y
선분에 대한 밀림
(Shy=1/2, xref=-1)