General rotation - PowerPoint PPT Presentation

1 / 42
About This Presentation
Title:

General rotation

Description:

4X4 matrix used to represent translation, scaling, and rotation ... But, can't efficiently compose rotations...must convert to matrices first! 28. Rotation matrix ... – PowerPoint PPT presentation

Number of Views:128
Avg rating:3.0/5.0
Slides: 43
Provided by: edan74
Category:

less

Transcript and Presenter's Notes

Title: General rotation


1
General rotation
2
Objectives
  • Rotations in general - define more
  • flexible rotation specifications

3
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

4
Translation
translation matrix
new point
old point
5
Scaling
scaling matrix
new point
old point
6
Rotation
X axis
Y axis
Z axis
7
Rotation about an arbitrary axis
  • Rotating about an axis by theta degrees
  • Rotate about x to bring axis to xz plane
  • Rotate about y to align axis with z -axis
  • Rotate theta degrees about z
  • Unrotate about y, unrotate about x
  • Can you determine the values of Rx and Ry?

M Rx-1 Ry-1 Rz(q) Ry Rx
8
Composite Transformations
  • Rotating about a fixed point
  • - basic rotation alone will rotate about origin
  • but we want

9
Composite Transformations
  • Rotating about a fixed point
  • Move fixed point (px,py,pz) to origin
  • Rotate by desired amount
  • Move fixed point back to original position

M T(px, py, pz) Rz(q) T(-px, -py, -pz)
10
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
11
Interpolation
  • In order to move things, we need both
    translation and rotation
  • Interpolating the translation is easy, but what
    about rotations?

12
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

13
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...
14
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)

15
Representing Rotation
  • Rotation matrix
  • Euler angle
  • Axis angle
  • Quaternion
  • Exponential map

16
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
17
Euler Angle Representation
  • Angles used to rotate about cardinal axes
  • Orientations are specified by a set of 3 ordered
    parameters that represent 3 ordered rotations
    about axes, ie. first about x, then y, then z
  • Many possible orderings, dont have to use all 3
    axes, but cant do the same axis back to back

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

19
Euler Angles and Rotation Matrices
20
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 youve lost a degree of freedom

21
Gimbal Lock
  • Phenomenon of two rotational axis of an object
    pointing in the same direction.
  • Result Lose a degree of freedom (DOF)

22
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
23
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,?, ?)
24
Euler Angles Interpolation ?Unnatural movement !
25
Representing Rotation
  • Rotation matrix
  • Euler angle
  • Axis angle
  • Quaternion
  • Exponential map

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

27
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, cant efficiently compose rotationsmust
    convert to matrices first!

28
Representing Rotation
  • Rotation matrix
  • Euler angle
  • Axis angle
  • Quaternion
  • Exponential map

29
Quaternion
4 tuple of real numbers
scalar
vector
Same information as axis angles but in a
different form
30
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

31
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

32
Quaternion Math
Unit quaternion
Multiplication
33
Quaternion Rotation
proof see Quaternions by Shoemaker
34
Matrix form
35
Quaternion interpolation
1-angle rotation can be represented by a unit
circle
  • Interpolation means moving on (n1)-D sphere
  • Now imagine a 4-D sphere for 3-angle rotation

36
Quaternion interpolation
  • Moving between two points on the 4D unit sphere
  • a unit quaternion at each step - another point on
    the 4D unit sphere
  • move with constant angular velocity along the
    great circle between the two points on the 4D
    unit sphere

37
Quaternion interpolation
Direct linear interpolation does not work
Linearly interpolated intermediate points are not
uniformly spaced when projected onto the circle
Spherical linear interpolation (SLERP)
Normalize to regain unit quaternion
38
Rotations in Reality
  • Its easiest to express rotations in Euler angles
    or Axis/angle
  • We can convert to/from any of these
    representations
  • Choose the best representation for the task
  • inputEuler angles
  • interpolation quaternions
  • composing rotations quaternions, orientation
    matrix

39
  • Rotation matrix
  • Fixed angle and Euler angle
  • Axis angle
  • Quaternion
  • Exponential map

40
Exponential map
  • Represent orientation as a vector
  • direction of the vector is the axis to rotate
    about
  • magnitude of the vector is the angle to rotate by
  • Zero vector represents the identity rotation

41
Properties of exponential map
  • No need to re-normalize the parameters
  • Fewer DOFs
  • Good interpolation behavior
  • Singularities exist but can be avoided

42
Choose a representation
  • Choose the best representation for the task
  • input
  • joint limits
  • interpolation
  • compositing
  • rendering

Euler angles
Euler angles, quaternion (harder)
quaternion or exponential map
quaternions or orientation matrix
orientation matrix ( quaternion can be
represented as matrix as well)
Write a Comment
User Comments (0)
About PowerShow.com