1 / 65

3D orientation

3D orientation. Rotation matrix Fixed angle and Euler angle Axis angle Quaternion Exponential map. 3 translational DOFs. 48 rotational DOFs. Joints and rotations. Rotational DOFs are widely used in character animation. Each joint can have up to 3 DOFs. 1 DOF: knee. 2 DOF: wrist.

mead
Download Presentation

3D orientation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 3D orientation

  2. Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion • Exponential map

  3. 3 translational DOFs 48 rotational DOFs Joints and rotations Rotational DOFs are widely used in character animation Each joint can have up to 3 DOFs 1 DOF: knee 2 DOF: wrist 3 DOF: arm

  4. Representation of orientation • Homogeneous coordinates (review) • 4X4 matrix used to represent translation, scaling, and rotation • a point in the space is represented as • Treat all transformations the same so that they can be easily combined

  5. Translation translation matrix new point old point

  6. Scaling new point scaling matrix old point

  7. Rotation X axis Y axis Z axis

  8. Composite transformations A series of transformations on an object can be applied as a series of matrix multiplications : position in the global coordinate : position in the local coordinate

  9. Interpolation • In order to “move things”, we need both translation and rotation • Interpolating the translation is easy, but what about rotations?

  10. Motivation • Finding the most natural and compact way to present rotation and orientations • Orientation interpolation which result in a natural motion • A closed mathematical form that deals with rotation and orientations (expansion for the complex numbers)

  11. Rotation Matrix • A general rotation can be represented by a single 3x3 matrix • Length Preserving (Isometric) • Reflection Preserving • Orthonormal

  12. Fixed Angle Representation • Angles used to rotate about fixed axes • Orientations are specified by a set of 3 ordered parameters that represent 3 ordered rotations about fixed axes, ie. first about x, then y, then z • Many possible orderings, don’t have to use all 3 axes, but can’t do the same axis back to back

  13. Fixed Angle Representation • A rotation of 10,45, 90 would be written as • Rz(90) Ry(45), Rx(10) since we want to first rotate about x, y, z. It would be applied then to the point P…. RzRyRx P • Problem occurs when two of the axes of rotation line up on top of each other. This is called “Gimbal Lock”

  14. Gimbal Lock • A 90 degree rotation about the y axis essentially makes the first axis of rotation align with the third. • Incremental changes in x,z produce the same results – you’ve lost a degree of freedom

  15. Gimbal Lock • Phenomenon of two rotational axis of an object pointing in the same direction. • Simply put, it means your object won't rotate how you think it ought to rotate.

  16. Interpolation of orientation • How about interpolating each entry of the rotation matrix? • The interpolated matrix might no longer be orthonormal, leading to nonsense for the in-between rotations

  17. Interpolation of orientation Example: interpolate linearly from a positive 90 degree rotation about y axis to a negative 90 degree rotation about y Linearly interpolate each component and halfway between, you get this...

  18. Properties of rotation matrix • Easily composed? • Interpolate?

  19. Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion • Exponential map

  20. Fixed angle • Angles used to rotate about fixed axes • Orientations are specified by a set of 3 ordered parameters that represent 3 ordered rotations about fixed axes • Many possible orderings

  21. Fixed angle • A rotation of Rz(90)Ry(60)Rx(30) looks like

  22. Euler angle • Same as fixed angles, except now the axes move with the object • An Euler angle is a rotation about a single Cartesian axis • Create multi-DOF rotations by concatenating Euler angles • evaluate each axis independently in a set order

  23. Z Y X Euler angle vs. fixed angle • Rz(90)Ry(60)Rx(30) = Ex(30)Ey(60)Ez(90) • Euler angle rotations about moving axes written in reverse order are the same as the fixed axis rotations

  24. z z z 3 /2 1 1 y y y 1 1 x x x x’ x’ Gimbal Lock (again!) • Rotation by 90o causes a loss of a degree of freedom

  25. Gimbal Lock • Phenomenon of two rotational axis of an object pointing in the same direction. • Simply put, it means your object won't rotate how you think it ought to rotate.

  26. Gimbal Lock A Gimbal is a hardware implementation of Euler angles used for mounting gyroscopes or expensive globes Gimbal lock is a basic problem with representing 3D rotation using Euler angles or fixed angles

  27. Gimbal lock When two rotational axis of an object point in the same direction, the rotation ends up losing one degree of freedom

  28. Properties of Euler angle • Easily composed? • Interpolate? • How about joint limit? • What seems to be the problem?

  29. Euler Angles • A general rotation is a combination of three elementary rotations: around the x-axis (x-roll) , around the y-axis (y-roll) and around the z-axis (z-roll).

  30. Euler Angles

  31. Euler Angles and Rotation Matrices

  32. y y π x x x-roll π y y y z z x π x x z-roll π y-roll π π z z z Euler angles interpolation R(0,0,0),…,R(t,0,0),…,R(,0,0) t[0,1] R(0,0,0),…,R(0,t, t),…,R(0,, )

  33. Euler Angles Interpolation Unnatural movement !

  34. Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion • Exponential map

  35. Goal • Find a parameterization in which • a simple steady rotation exists between two key orientations • moves are independent of the choice of the coordinate system

  36. Axis angle • Represent orientation as a vector and a scalar • vector is the axis to rotate about • scalar is the angle to rotate by

  37. Angle and Axis • Any orientation can be represented by a 4-tuple • angle, vector(x,y,z) where the angle is the amount to rotate by and the vector is the axis to rotate about • Can interpolate the angle and axis separately • No gimbal lock problems! • But, can’t efficiently compose rotations…must convert to matrices first!

  38. Angular displacement • (,n) defines an angular displacement of  about an axis n

  39. Properties of axis angle • Can avoid Gimbal lock. Why? • Can interpolate the vector and the scalar separately. How?

  40. Axis angle interpolation

  41. Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion • Exponential map

  42. Quaternion 4 tuple of real numbers: scalar vector Same information as axis angles but in a different form

  43. Quaternions ? • Extend the concept of rotation in 3D to 4D. • Avoids the problem of "gimbal-lock" and allows for the implementation of smooth and continuous rotation. • In effect, they may be considered to add a additional rotation angle to spherical coordinates ie. Longitude, Latitude and Rotation angles • A Quaternion is defined using four floating point values |x y z w|. These are calculated from the combination of the three coordinates of the rotation axis and the rotation angle.

  44. How do quaternions relate to 3D animation? • Solution to "Gimbal lock" • Instead of rotating an object through a series of successive rotations, a quaternion allows the programmer to rotate an object through a single arbitary rotation axis. • Because the rotation axis is specifed as a unit direction vector, it may be calculated through vector mathematics or from spherical coordinates ie (longitude/latitude). • Quaternions interpolation : smooth and predictable rotation effects.

  45. Quaternion to Rotation Matrix

  46. Quaternions Definition • Extension of complex numbers • 4-tuple of real numbers • s,x,y,z or [s,v] • s is a scalar • v is a vector • Same information as axis/angle but in a different form • Can be viewed as an original orientation or a rotation to apply to an object

  47. Quaternions Math

  48. Quaternions properties • The conjugate and magnitude are similar to complex numbers • Quaternions are non commutative q1 = (s1,v1) q2 = (s2,v2) q1*q2 = (s1s2 – v1.v2 , s1v2 + s2v1 + v1x v2) • inverse: • unit quaternion:

  49. Quaternion Rotation To rotate a vector, v using quaternion math • represent the vector as [0,v] • represent the rotation as a quaternion, q

  50. Quaternions as Rotations • Rotation of P=(0,r) about the unit vector n by an angle θ using the unit quaternion q=(s,v) but q=(cos½θ, sin½θ•n) where |n|=1

More Related