3D Graphics
기본 수학
cadion
2024. 5. 22. 19:21
Dot Product ( Inner Product )
- result = ( Ax*Bx, Ay*By )
- |result| = |A|*|B|*cos(theta)
Cross Product ( Outer Product )
- |result| = |A|*|B|*sin(theta) (평행사변형넓이)
- dir(result) = A와B가 이루는 면의 normal vector ( 오른손법칙 )
- result = ( Ay*Bz-Az*By, Az*Bx - Ax*Bz, Ax*By - Ay*Bx )
Interpolation
Linear Inter. ( lerp ) : p(α) = p0 + α(p1 -p0)
Sphere Lerp ( Slerp ) : p(α) = ( qrt p0 ^ ( α ) ) * ( qrt p1 ^ ( 1 - α ) )
Affine Transform ( object basis - u, v, n )
SRT matrix ( scaling - rotation - translation ) for object space
만들땐 회전행렬 x3
역계산(값산출) 할떈 상위의 규칙에 따라 역행렬 산출-적용
( u*v = 0, v*n = 0, n*u = 0 )
PreAttribute = position, normal
- [R | t] ( rigid motion )
- pre-post 합동