Orientations - PowerPoint PPT Presentation

About This Presentation
Title:

Orientations

Description:

Orientations Goal: Convenient representation of orientation of objects & characters in a scene Applications to: inverse kinematics rigid body simulation – PowerPoint PPT presentation

Number of Views:98
Avg rating:3.0/5.0
Slides: 19
Provided by: ubc45
Category:

less

Transcript and Presenter's Notes

Title: Orientations


1
Orientations
  • Goal
  • Convenient representation of orientation of
    objects characters in a scene
  • Applications to
  • inverse kinematics
  • rigid body simulation
  • rag doll physics
  • etc.

2
Euler Angles
  • so far, used one angle per axis, ie. Euler
    angles.
  • Pros
  • Simple!
  • Cons
  • Singularities (gimbal lock)
  • Interpolation is tricky
  • Composing rotations is tricky

3
Singularities
  • Singularities may arise when axes are rotated to
    coincide
  • Lose a degree of freedom
  • Consider an airplanes roll-pitch-yaw
  • eg. (0,90,0) vs. (90,90,90) identical position
  • IK problems
  • Infinitely many solutions if coincident
  • Ill-posed when very close to coincident

4
Interpolation
  • Vital for keyframe animation, blending mocap
    data, etc.
  • Linear interpolating each angle independently
    gives odd behaviour near singularities
  • Not coordinate independent
  • For 2 orientations, rotate-interpolate gives a
    different result than interpolate-rotate

5
Composition
  • Given two rotations applied sequentially, find a
    single orientation that gives the same result.
  • Not at all obvious how to handle this

6
3x3 Orthogonal Matrices
  • Eliminate many issues of Euler angles, but
  • Hard to work with 9 components, 6 constraints
  • Highly redundant
  • Linear interpolation doesnt work

7
3x3 Orthogonal Matrices
  • But
  • Very effective for quickly transforming many
    points
  • Composition is straightforward multiply
  • Still useful, but not as our primary
    representation

8
Axis-angle
  • Unit axis vector and an angle indicating how much
    to rotate.
  • Very intuitive
  • 4 numbers, 1 constraint less redundant
  • Comparison, interpolation, composition still
    difficult.

9
2D Rotations
  • Can use complex numbers to represent 2D rotations
  • View a point (x,y) as x iy
  • Rotation about origin is multiplication by
  • cos(theta) isin(theta)
  • Equivalently, e(itheta)
  • ie. A unit magnitude complex number

10
2D Rotations
  • And composition is again multiplication
  • Isnt this overkill?
  • In 2D, yes
  • But this idea extends elegantly to 3D

11
Quaternions
  • Generalizes complex numbers
  • Two additional sqrt(-1) terms, j and k
  • Form a bi cj dk
  • Behave mostly like regular numbers
  • But NOT commutative! ab ? ba

12
Quaternions
  • Small set of simple multiplication rules
  • ii -1, jj -1, kk -1
  • ij k, jk i, ki j
  • ji -k, kj-i, ik -j
  • When j k components are 0, this reverts to
    basic complex numbers
  • ie. 2D rotations.

13
Rotating points
  • Given complex number
  • Conjugate is
  • Then
  • If q is unit magnitude, just gives back 0 ix
  • Real part remains 0, imaginary part retains its
    length, x

14
Rotating points
  • Quaternion
  • Conjugate
  • Zero real-part quaternion
  • Consider
  • Real part stays 0, imaginary part keeps length
  • For unit q, this is a rotation of the vector
    (x,y,z) in quaternion form

15
Quaternion Rotation
  • So, to perform a rotation by unit quaternion q on
    vector v (x,y,z) to get new vector v
    (x,y,z) just do

16
Quaternion Rotation
  • Unit-length quaternions can represent any
    orientation in 3D, without singularities
  • Relation to axis-angle form
  • Real part is cos(theta/2)
  • Imaginary part is vector parallel to the rotation
    axis
  • Redundancy q -q
  • But since the two possible representations are
    maximally far apart, no harm done.

17
Quaternion Interpolation
  • Interpolation is much more convenient
  • linear interpolating, then renormalizing q to
    unit-length works fairly well
  • For better results, ensure dot product of their
    imaginary parts is non-negative,by flipping sign,
    since q -q is the same orientation.
  • We want the two quaternions axes to be
    pointing in the same direction, so that the
    interpolation path is as short as possible.
  • For improved interpolation of unit vectors, look
    into slerp

18
Quaternion Composition
  • Similar to matrix form, just multiply
  • Consider 2 quaternion rotations applied to a
    point 0ixjykz
  • or
Write a Comment
User Comments (0)
About PowerShow.com