Download presentation
Presentation is loading. Please wait.
Published byColleen Henderson Modified over 9 years ago
1
Rick Parent - CIS681 ORIENTATION Use Quaternions Interpolating rotations is difficult
2
Rick Parent - CIS681 Object Representation Desired operations Interpolation between transformations Concatenation of one transformation after another Define object in world space Object space data Scale Rotation Translation Handle scale, rotation, translation, independently Rotation deserves special attention!
3
Rick Parent - CIS681 Repeated Rotations: Error Management Task: Rotate an object some every frame Issue: Avoiding accumulated roundoff error
4
Rick Parent - CIS681 Repeated Rotations: Error Management Method 2 D = create_rotation_matrix( ) M create_rotation_matrix( ) M = D M Object = apply M to object Method 1 M = create_rotation_matrix( ) Object = apply M to Object Method 3 = + M = create_rotation_matrix( ) Object = apply M to object <= repeat
5
Rick Parent - CIS681 Orientation Representation orientation
6
Rick Parent - CIS681 Interpolation O1O1 O2O2 O 1.5
7
Rick Parent - CIS681 Concatenation O1O1 O2O2
8
Rick Parent - CIS681 Orientation Representation Rotation Matrix Fixed Angles Euler Angles Axis-Angle Quaternion
9
Rick Parent - CIS681 Rotation Matrices 0 0 0 1 a d g b c ef h i 000 9 values but 3 degrees of freedom Euler’s rotation theorem: An arbitrary rotation may be described by only three parameters.
10
Rick Parent - CIS681 Rotation Matrices 0 0 0 1 0 1 0 0 00 0 1 000 0 0 0 1 0 0 1 0 00 0 1 000 Can’t interpolate rotation matrices 90 o z-axis -90 o z-axis 0 0 0 1 0 0 0 0 0 00 0 1 000 ??
11
Rick Parent - CIS681 Fixed Angles E.g., ( z, y, x ) X Z Y Q = R x ( x ). R y ( y ). R z ( z ). P 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.
12
Rick Parent - CIS681 Fixed Angles X Z Y X Z Y Note: left-hand coordinate system Original orientation Orientation represented by (0,90,0) Using order z-y-x
13
Rick Parent - CIS681 Fixed Angles (45,90,0) X Z Y X Z Y Original Using order z-y-x
14
Rick Parent - CIS681 Gimbal Lock From (0,90,0), how can the object change its orientation? X Z Y a) ( ,90,0) b) ( ,90+ ,0) c) ( ,90, ) What do these do? Using order z-y-x
15
Rick Parent - CIS681 Fixed Angles (-45,90,0) (0,90,0) X Z Y Z X Y Is same as X-axis rotation (0,90,45) (0,90,0) Changing Z-axis parameter
16
Rick Parent - CIS681 Fixed Angle Interpolation (0,90,0) to (90,0,90) (0,0,0) (90,0,90) (0,90,0)
17
Rick Parent - CIS681 Euler Angles Ordered triple of rotations about local axes, As with fixed angles, 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. X Y Z x y z
18
Rick Parent - CIS681 Euler Angles X Y Z x y z Use (z,y,x) Show that Euler angle ordering is equivalent to reverse ordering in fixed angles …and so has the same problems
19
Rick Parent - CIS681 Axis-Angle (A x,A y,A z, ) Euler’s rotation theorem: An arbitrary rotation may be described by only three parameters. X Y Z Rotate object by around A ?
20
Rick Parent - CIS681 Axis-Angle Interpolation 1. Interpolate axis from A1 to A2 Rotate axis about A1 x A2 to get A X Y Z 2. Interpolate angle from 1 to to get 3. Rotate object by around A A1 x A2
21
Rick Parent - CIS681 Quaternions (cos( /2),sin( /2)*A) q =[s,v]=[s,x,y,z] Has the same information as axis-angle but in a more computational-friendly form
22
Rick Parent - CIS681 Quaternions Basic math operations
23
Rick Parent - CIS681 Quaternions - rotate a point v = (x,y,z) => [0,v]
24
Rick Parent - CIS681 Composite transformations Rotation by p then by q is the same as rotation by qp (where qp is quaternion q multiplied by quaternion p)
25
Rick Parent - CIS681 Quaternion Rotation q ||q|| Unit quaternion =>
26
Rick Parent - CIS681 Quaternion Interpolation Fixed angles (90,0,90) (0,90,0) quaternions [0.7,0.0,0.7,0.0] [0.5,0.5,0.5,0.5]
27
Rick Parent - CIS681 Quaternion Interpolation Linearly interpolating fixed angles from (0,90,0) to (90,0,90) Interpolating quaternions from (0.5,0.0,1.0,0.0) to (0.5,0.5,0.5,0.5) using sphereical linear interpolation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.