오일러 각이란 물체를 3가지 성분을 이용해 회전을 표현하는 것이다.
보통 엔진에서 pitch, Roll, Yaw로 표현하고.
(pitch는 x축 기준 회전 ,Yaw는 y축 기준 회전, Roll은 z축 기준 회전이다.)
오일러 각에 따른 Forward, Up, Right 벡터
Forward:(0,0,1,1)
Up:(0,1,0,1)
Right:(1,0,0,1)
RotationMatrix = Rz * Ry * Rx
(곱하는 순서 틀리지 말것.)
언리얼 소스코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
FORCEINLINE FInverseRotationMatrix::FInverseRotationMatrix(const FRotator& Rot)
: FMatrix(
FMatrix( // Yaw
FPlane(0.0f, 0.0f, 1.0f, 0.0f),
FPlane(0.0f, 0.0f, 0.0f, 1.0f)) *
FMatrix( // Pitch
FPlane(0.0f, 1.0f, 0.0f, 0.0f),
FPlane(0.0f, 0.0f, 0.0f, 1.0f)) *
FMatrix( // Roll
FPlane(1.0f, 0.0f, 0.0f, 0.0f),
FPlane(0.0f, 0.0f, 0.0f, 1.0f))
)
{ }
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
26. 3D 카메라 뷰 변환 행렬
지난 시간에 벡터의 외적 연산과 외적 연산의 용도(25강)에 대해 알아보았고 이전에는 3D 좌표계의 회전 ...
blog.naver.com
평면의 방정식과 D의 의미 (0) | 2019.12.19 |
---|---|
카메라의 뷰 좌표계와 LookAt 행렬 유도하기 (0) | 2019.12.19 |
투영벡터 (0) | 2019.12.19 |
왼손좌표계와 오른손 좌표계 (0) | 2019.12.19 |
삼각형 내부 외부 판별 (0) | 2019.12.19 |