1 / 73

CSCE 689: Computer Animation Rotation Representation and Interpolation

CSCE 689: Computer Animation Rotation Representation and Interpolation. Jinxiang Chai. Joints and Rotation. Rotational dofs are widely used in character animation. 3 translation dofs 48 rotational dofs. 1 dof: knee. 2 dof: wrist. 3 dof: shoulder. Orientation vs . Rotation .

chern
Download Presentation

CSCE 689: Computer Animation Rotation Representation and Interpolation

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. CSCE 689: Computer Animation Rotation Representation and Interpolation Jinxiang Chai

  2. Joints and Rotation Rotational dofs are widely used in character animation 3 translation dofs 48 rotational dofs 1 dof: knee 2 dof: wrist 3 dof: shoulder

  3. Orientation vs. Rotation  • Orientation is described relative to some reference alignment • A rotation changes object from one orientation to another • Can represent orientation as a rotation from the reference alignment 

  4. Ideal Orientation Format  • Represent 3 degrees of freedom with minimum number of values • Allow concatenations of rotations • Math should be simple and efficient • concatenation • interpolation • rotation

  5. Outline • Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion

  6. 3D Transformation • A 3D point (x,y,z) – x,y, and z coordinates • We will still use column vectors to represent points • Homogeneous coordinates of a 3D point (x,y,z,1)T • Transformation will be performed using 4x4 matrix

  7. Right-handed Coordinate System Left hand coordinate system Not used in this class and Not in OpenGL

  8. 3D Transformation Homogenous coordinates Very similar to 2D transformation Translation transformation

  9. 3D Transformation Homogenous coordinates Very similar to 2D transformation Scaling transformation

  10. 3D Rotation y + x z 3D rotation is done around a rotation axis Fundamental rotations – rotate about x, y, or z axes Counter-clockwise rotation is referred to as positive rotation (when you look down negative axis)

  11. 3D Rotation y + x z Rotation about z – similar to 2D rotation

  12. 3D Rotation z y x y x z Rotation about y: z -> y, y -> x, x->z

  13. 3D Rotation x z y y x z Rotation about x (z -> x, y -> z, x->y)

  14. 3D Rotation y x z An arbitrary rotation can be defined by a matrix

  15. Matrices as Orientation  • Matrices just fine, right? • No… • 9 values to interpolate • don’t interpolate well

  16. 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

  17. Rotation old points New points rotation matrix

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

  19. 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 inbetween rotations

  20. 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... Rotate about y-axis with 90 Rotate about y-axis with -90

  21. Properties of Rotation Matrix Easily composed? Interpolation? Compact representation?

  22. Properties of Rotation Matrix Easily composed? yes Interpolation? Compact representation?

  23. Properties of Rotation Matrix Easily composed? yes Interpolation? not good Compact representation?

  24. Properties of Rotation Matrix Easily composed? yes Interpolation? not good Compact representation? - 9 parameters (only needs 3 parameters)

  25. Outline • Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion

  26. Fixed Angles • 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: x-y-z, x-y-x,y-x-z - as long as axis does immediately follow itself such as x-x-y

  27. Y X Z Fixed Angles Ordered triple of rotations about global axes, any triple can be used that doesn’t immediately repeat an axis, e.g., x-y-z, is fine, so is x-y-x. But x-x-z is not. E.g., (qz, qy, qx) Q = Rx(qx). Ry(qy). Rz(qz). P

  28. Euler Angles vs. Fixed Angles One point of clarification Euler angle - rotates around local axes Fixed angle - rotates around world axes Rotations are reversed - x-y-z Euler angles == z-y-x fixed angles

  29. Euler Angle Interpolation • Interpolating each components separately • Might have singularity problem • Halfway between (0, 90, 0) & (90, 45, 90) • Interpolate directly, get (45, 67.5, 45) • Desired result is (90, 22.5, 90) (verify this!)

  30. Euler Angle Concatenation  • Can't just add or multiply components • Best way: • Convert to matrices • Multiply matrices • Extract Euler angles from resulting matrix • Not cheap

  31. Gimbal Lock  • Euler/fixed angles not well-formed • Different values can give same rotation • Example with z-y-x fixed angles: ( -90, 90, 90 ) = ( 0, 90, 0 )

  32. z y x Gimbal Lock  • Euler/fixed angles not well-formed • Different values can give same rotation • Example with z-y-x fixed angles: ( -90, 90, 90 ) = ( 0, 90, 0 )

  33. z y x Gimbal Lock  • Euler/fixed angles not well-formed • Different values can give same rotation • Example with z-y-x fixed angles: ( -90, 90, 90 ) = ( 0, 90, 0 ) z (-90,0,0) x y

  34. z y x Gimbal Lock  • Euler/fixed angles not well-formed • Different values can give same rotation • Example with z-y-x fixed angles: ( -90, 90, 90 ) = ( 0, 90, 0 ) z (-90,0,0) (-90,90,0) x x y z y

  35. z y x Gimbal Lock  • Euler/fixed angles not well-formed • Different values can give same rotation • Example with z-y-x fixed angles: ( -90, 90, 90 ) = ( 0, 90, 0 ) z (-90,0,0) (-90,90,0) (-90,90,90) y x x y z z y x

  36. 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

  37. Gimbal Lock • When two rotational axis of an object pointing in the same direction, the rotation ends up losing one degree of freedom

  38. Outline • Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion

  39. Axis Angle Rotate object by q around A (Ax,Ay,Az,q) A q Y Z X Euler’s rotation theorem: An arbitrary rotation may be described by only three parameters.

  40. Axis-angle Rotation Given r – Vector in space to rotate n – Unit-length axis in space about which to rotate q – The amount about n to rotate Solve r’ – The rotated vector r’ r n

  41. Axis-angle Rotation • Compute rpar: the projection of r along the n direction rpar = (n·r)n r’ rpar r

  42. Axis-angle Rotation • Compute rperp: rperp = r-rpar rperp rpar r’ r

  43. Axis-angle Rotation • Compute v: a vector perpedicular to rpar and rperp: v= rparxrperp v rperp rpar r’ r

  44. Axis-angle Rotation • Compute v: a vector perpedicular to rpar and rperp: v= rparxrperp v rperp rpar r’ Use rpar, rperp and v, θ to compute the new vector! r

  45. Axis-angle Rotation rperp = r – (n·r) n q V =nx (r – (n·r) n) = nxr r’ rpar = (n·r) n r n r’ = r’par + r’perp = r’par + (cos q) rperp + (sin q) V =(n·r) n + cos q(r – (n·r)n) + (sin q) n x r = (cos q)r + (1 – cos q) n (n·r) + (sin q) n x r

  46. Axis-angle Rotation • Can interpolate rotation well

  47. Axis-angle Interpolation 1. Interpolate axis from A1 to A2 Rotate axis about A1 x A2 to get A A1 q1 A Y q A2 A1 x A2 2. Interpolate angle from q1 to q2 to get q q2 Z X 3. Rotate the object by q around A

  48. Axis-angle Rotation • Can interpolate rotation well • Compact representation • Messy to concatenate - might need to convert to matrix form

  49. Outline • Rotation matrix • Fixed angle and Euler angle • Axis angle • Quaternion

  50. Quaternion Remember complex numbers: a+ib, where i2=-1 Quaternions are a non-commutative extension of complex numbers Invented by Sir William Hamilton (1843) Quaternion: - Q = a + bi + cj + dk: where i2=j2=k2=ijk=-1,ij=k,jk=i,ki=j - Represented as: q = (w, v) = w + xi + yj + zk

More Related