☁️ DirectX

☁️ Scaling
🔎 2D Scaling
- Sx, Sy = scaling factors
x축으로 Sx배
y축으로 Sy배

☁️ Rotation
- Couterclockwse (CCW)
양의 각도
- Clockwise (CW)
음의 각도

☁️ Translation
- scaling , rotation과 달리 translation은 벡터의 덧셈이다

- homogeneous coordinate라면 곱셈으로도 나타낼 수 있다

🔎 homogeneous coordinate ( 동차좌표계 )
- (x, y)를 (x, y, 1)로 표현하는 것
- 임의의 0이 아닌 상수 w에 대해 (x, y)를 (wx, wy, w)로 표현하는 것
homogeneous 좌표계에서 스케일(scale)은 무시되며 (x, y)에 대한 homogeneous 좌표 표현은 무한히 많이 존재한다


- 위의 예시는 OpenGL 버전 (column vector)
- Noncommutative (RT != TR)
- 순서에 주의 해야한다!
- DirectX의 경우 (0,4,1)RT -> row vector
🔎 Rotation about an arbitrary point
= 임의의 점을 기준으로 회전하고 싶을 때
- 회전 기준이 되는 점을 원점으로 옮긴다
- 회전
- 원점에서 원래 위치로 옮겨준다.

- Linear transform (Scaling, Rotation..) = 단순 이동 계산
- Translation = 특수 처리
여러 개의 아핀 변환도 하나의 matrix로 합쳐질 수 있다!
🔎 [L∣t]
= 2 x 3 elements
- L : combined linear transform
- t : combined translation
- 빨간 부분이 L, 파란부분이 t

- Lp+t (p = 옮길 point)
- L이 먼저 적용된다.
- linear transform이 완료된 object를 t로 옮겨준다.

☁️ Rigid Motion
- rotation과 translation만 존재 / scaling은 포함 X
- affine matrix를 적용하면 pose(position + orientation)는 변화지만 물체의 모양은 바뀌지 않는다.
[R∣t]
- R : combined rotation
- t : combined translation
☁️ 3D Scaling

☁️ 3D Rotation



☁️ 3D Translation


☁️ Inverse

- R-1 = RT
