728x90
728x170
3D Rotation and Orientation
Orientation vs. Rotation
- Rotation
- Circular movement
- Orientation
- The state of being oriented.
- Given a coordinate system, the orientation of an object can be represented as a rotation from a reference pose.
- Analogy
- (point : vector) is similar to (orientation : rotation)
- Both represent a sort of (state : movement)
What is 3D Rotation?
- Many different ways to describe
- Rotation matrices
- Euler angles
- Axis-angle
- Rotation vector
- Unit quaternions
Euler's Rotation Theorem
- The general displacement of a rigid body with one point fixed is a rotation about some axis. - Leonhard Euler (1707-1783)
- In other words,
- Arbitary 3D rotation euqals to one rotation around an axis.
- Any 3D rotation leaves one vector unchanged
3D rotation
- Given two arbitrary orientations of a rigid object,
Axis-Angles (or Rotation Vector)
Axis-Angles
Rotation Vector
Rotation vector → Axis-Angle?
- Rotation Vector
- $q = (3, 6, 7)$
- Axis-Angle
- axis : $\hat{v} = ?$
- $(\frac{3}{\sqrt{94}}, \frac{6}{\sqrt{94}}, \frac{7}{\sqrt{94}})$
- angle : $\theta = ?$
- $\sqrt{94}$
- axis : $\hat{v} = ?$
Rotate a point $p$ by an axis-angle?
Axis-Angle → Rotation Matrix
Step 1: Rotate $u$ on the z-axis
- Rotate $u$ onto the z-axis
- Rotate $u$ onto the z-axis
- $u'$ : Project $u$ onto the yz-plane to compute angle $\alpha$
- $u''$ : Rotate $u$ about the x-axis by angle $\alpha$
- Rotate $u''$ onto the z-axis
- Rotate $u'$ about the x-axis onto the yz-plan
- Let $u = (a, b, c)$ and thus $u' = (0, b, c)$
- Let $u_{z} = (0, 0, 1)$
- Rotate $u'$ about the x-axis onto the yz-plan
- Since we know both $cos(\alpha)$ and $sin(\alpha)$, the rotation matrix can be obtained.
Axis-Angle → Rotation Matrix
- Rotate the axis, $u$ on the z-axis
- $R_{y}(\beta) · R_{x}(\alpha)$
- Rotate $p$ around the z-axis
- $R_{z}(\theta)$
- Rotate to the original axis
- $R_{x}^{-1}(\alpha) · R_{y}^{-1}(\beta)$
Rotate a point $p$ by an axis-angle?
Orientations by Axis-Angles
Euler Angles
Euler Angles
- A sequence of three elemental rotations
- elemental rotations: rotation about x, y, or z-axis
- e.g) $(\alpha, \beta, γ) → R_{z}(γ)R_{y}(\beta)R_{x}(\alpha)$
- Rotation about three orthogonal axes
- 12 combinations
- XYZ, XYX, XZY, XZX
- YZX, YZY, YXZ, YXY
- ZXY, ZXZ, ZYX, ZYZ
- 12 combinations
Gimbal
- Hardware implementation of Euler Angles
- Aircraft, Camera
Gimbal Lock
- Coincidence of inner most and outmost gimbals' rotation axes
- Loss of degree of freedom
- https://compsci290-s2016.github.io/CoursePage/Materials/EulerAnglesViz/index.html
Pros and Cons
- Cons
- Many-to-one mappong.
- Discontinuity.
- Gimbal lock problem.
- Pros
- Simple and intuitive.
- The most dominant method for end-user interface.
Rotation Matrices (SO(3) matrices)
SO(3) Group
- Rotation matrices from SO(3)
- One matrix in SO(3) corresponds to one unique 3D orientation.
- One-to-one mapping between SO(3) group and 3D orientations.
3D Rotation about z-axis, x-axis, and y-axis
Rotation about an arbitary-axis?
Axis-angle → Rotation Matrix
Rotation matrix $q_{r}$ that rotates from $q_{1}$ to $q_{2}$
Orientations and Rotations
- Orientations by SO(3) matrices
- SO(3) matrices are good for representing 3D orientations because they provide one-to-one mapping and no singularity
- Rotations by SO(3) matrices
- Matrix representation allow to handle the rotation and translation in a uniform way.
- e.g) 4x4 homogeneous matrices.
- But, SO(3) matrices cannot represent more than 360 degree rotational movement.
- Matrix representation allow to handle the rotation and translation in a uniform way.
Disadvantages of using 3x3 matrices
- Many parameters
- 9 real numbers for one matrix.
- Many calculations
- Matrix addition, multiplication, and inverse.
- Normalization problem
- Repeated calculations yield numerical errors.
- At some point, the result matrix may not be in SO(3).
- You need to normalize the matrix regularly during a series of calculations.
- Interpolation?
- Slerp is difficult.
Quaternions
Complex numbers and Quaternions
- William Rowan Hamilton (1805-1865)
Review the complex numbers in 2D
Can $S^{2}$ include all the possible orientations in 3D space?
What about $S^{3}$?
Unit Quaternions
Rotations and Unit Quaternions
Question
- What is the unit quaternion for 90˚ rotation along x-axis?
$ = \begin{bmatrix} cos45˚ \\ 1·sin45˚ \\ 0·sin45˚ \\ 0·sin45˚ \end{bmatrix} $ $ = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \\ 0 \\ 0 \end{bmatrix} $ |
Antipodal Equivalence
- $q = (w, x, y, z)$ and $-q = (-w, -x, -y, -z) $ represent the same rotation
- 2-to-1 mapping between $S^{3}$ and $SO(3)$
Unit Quaternion Algebra
- Identity
- $q = (1, 0, 0, 0)$
- Multiplication
- $q_{1}q_{2} = (w_{1}, v_{1})(w_{2}, v_{2}) = (w_{1}w_{2} - v_{1}v_{2}, w_{1}v_{2} + w_{2}v_{1} + v_{1}×v_{2})$
- Inverse
- $q^{-1} = \frac{(w, -x, -y, -z)}{(w^{2} + x^{2} + y^{2} + z^{2})} = \frac{(-w, x, y, z)}{(w^{2} + x^{2} + y^{2}+ z^{2})}$
- Unit quaternion space is
- closed under multiplication and inverse,
- but not closed under addition and subtraction
Rotation Quaternion
- Rotation quaternion, $q_{r}$ that rotates from $q_{1}$ to $q_{2}$
- Rotate a point $p$ by quaternion $q$
Rotate a point $p$ by an axis-angle
Quaternion Exp and Log
Exponential Map
- Map from a trangent plane to the manifold.
Quaternion Exp and Log
Rotation Quaternion
Exp and Log
Interpolation
Rotation Matrix vs. Unit Quaternion
- Equivalent in many aspects
- No singularity (continuous)
- Exp & Log
- Special tangent space
- Why quaternions?
- Fewer parameters
- Simpler algebra
- Easy to to fix numerical error
- Why rotation matrices?
- One-to-one correspondence
- Handle rotation and translation in a uniform way
- Eg) 4x4 homogeneous matrices
Rotation Conversions
- In theory, conversion between any representations is possible
- In practice, conversion is not simple because of different conventions.
- Quaternion to Matrix
728x90
그리드형(광고전용)
'Computer Graphics' 카테고리의 다른 글
[Computer Animation] Keyframing and Splines (0) | 2022.05.01 |
---|---|
[Unreal Engine 4] 블루프린트 클래스(Blueprint Class)에 Static Mesh 연결하기 (0) | 2022.04.24 |
[Unreal Engine 4] 새로운 월드 생성 & 기본 환경 설정 (0) | 2022.04.16 |
[Computer Animation] Slerp(Spherical Linear Interpolation) (0) | 2022.04.10 |
[Computer Animation] 2D Rotation and Orientation (0) | 2022.04.03 |
[Computer Animation] Linear Interpolation (0) | 2022.03.26 |
[Computer Animation] Geometric Transformations (0) | 2022.03.26 |
[Computer Animation] Vector Operations (0) | 2022.03.15 |