Chapter 62: computer graphics

62.1 Cem Yuksel

62.1.1 introduction

https://www.youtube.com/playlist?list=PLplnkTzzqsZTfYh4UbhLGpI5kGd5oW_Hh

62.1.1.1 2D transformation

https://www.youtube.com/watch?v=EKN7dTJ4ep8&list=PLplnkTzzqsZTfYh4UbhLGpI5kGd5oW_Hh&index=6

62.1.1.1.1 translation

p=p+t[pxpy]=[pxpy]+[txty]=[px+txpy+ty]

62.1.1.1.2 scale

p=sp[pxpy]=s[pxpy]=[spxspy]

62.1.1.1.3 non-uniform scale

p=[pxpy]=[sxpxsypy]=[sx00sy][pxpy]=Sp

62.1.1.1.4 rotation

p=pxˆx+pyˆy=px[10]+py[01]=[1001][pxpy]=Ip

p=px[cosθsinθ]+py[sinθcosθ]=[cosθsinθsinθcosθ][pxpy]=Rθp

p=px[cosθsinθ]+py[sinθcosθ]=[cosθsinθsinθcosθ][pxpy]=Rθp

62.1.1.1.5 skew = rotation + non-uniform scale + rotation

backp=[pxpy]=[cosθsinθsinθcosθ][sx00sy][cosθsinθsinθcosθ][pxpy]=RθSRθp

62.1.1.1.6 any 2×2 matrix

p=Mp

SVD = singular value decomposition

M=UΣVe.g.=RSR=RθSRθ

any 2×2 matrix + translation

p=Mp+t

p=M2(M1p+t1)+t2

62.1.1.1.7 homogeneous coordinate

p=p+t

p=Tp=p+t

[pxpy]=[px+txpy+ty]=[10tx01ty][pxpy1]

p=[pxpy1]=[px+txpy+ty1]=[10tx01ty001][pxpy1]=Tp

p=Mpp=[pxpy1]=[acebdf001][pxpy1]=Mp

62.1.1.1.8 position vs. direction

position vector: transformation affected by rotation and translation

p=[pxpy1]=[acebdf001][pxpy1]=Mp

direction vector: transformation affected by only rotation but not translation

d=[pxpy0]=[acebdf001][pxpy0]=Md

62.1.1.2 3D transformation

https://www.youtube.com/watch?v=1z1S2kQKXDs&list=PLplnkTzzqsZTfYh4UbhLGpI5kGd5oW_Hh&index=7

62.1.1.2.1 homogeneous coordinate

affine transformation

p=[pxpy1]=[acebdf001][pxpy1]=Mp

p=[pxpypz1]=[adgjbehkcfil0001][pxpypz1]=Mp

62.1.1.2.2 scale

p=[pxpypz1]=[sx0000sy0000sz00001][pxpypz1]=Sp

62.1.1.2.3 translation

p=[pxpypz1]=[100tx010ty001tz0001][pxpypz1]=Tp