681 - Introduction to Computer Graphics - PowerPoint

W
Shared by: HC120914141150
Categories
Tags
-
Stats
views:
2
posted:
9/14/2012
language:
Unknown
pages:
27
Document Sample
scope of work template
							     ORIENTATION


Interpolating rotations is difficult


       Use Quaternions




                                       Rick Parent - CIS681
Object Representation
   Define object in world space
      Object space data
      Scale
      Rotation
      Translation

   Desired operations
   Interpolation between transformations
   Concatenation of one transformation after another

   Handle scale, rotation, translation, independently

   Rotation deserves special attention!

                                                   Rick Parent - CIS681
Repeated Rotations: Error Management


Task: Rotate an object some Dq every frame



Issue: Avoiding accumulated roundoff error




                                             Rick Parent - CIS681
Repeated Rotations: Error Management
Method 1
M = create_rotation_matrix(Dq)
Object = apply M to Object   <= repeat

Method 2
D = create_rotation_matrix(Dq)
M create_rotation_matrix(q)
M=DM
                              <= repeat
Object = apply M to object

Method 3
q = q + Dq
M = create_rotation_matrix(q) <= repeat
Object = apply M to object
                                          Rick Parent - CIS681
Orientation Representation


         orientation




                             Rick Parent - CIS681
     Interpolation



O1

              O 1.5



O2




                      Rick Parent - CIS681
Concatenation


           O1

                O2




                     Rick Parent - CIS681
Orientation Representation

     Rotation Matrix


     Fixed Angles


     Euler Angles


     Axis-Angle


     Quaternion


                             Rick Parent - CIS681
Rotation Matrices


                a      b     c      0
                d      e     f      0
                g      h     i      0

                0      0     0      1


        9 values but 3 degrees of freedom
    Euler’s rotation theorem: An arbitrary rotation
    may be described by only three parameters.
                                                      Rick Parent - CIS681
Rotation Matrices
                     Can’t interpolate
                     rotation matrices

   0   -1 0      0                       0 1 0     0
   1   0 0       0                       -1 0 0    0
   0   0 1       0                       0 0 1     0
                                         0   0 0   1
   0   0 0       1

    90o z-axis                           -90o z-axis
                      0    0    0   0
                      0    0    0   0
                      0    0    1   0
                      0    0    0   1
                               ??
                                                       Rick Parent - CIS681
Fixed Angles
                         Ordered triple of
                         rotations about global
                         axes, any triple can be
    Y
                         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.
Z           X


           E.g., (qz, qy, qx)

        Q = Rx(qx). Ry(qy). Rz(qz). P

                                                  Rick Parent - CIS681
Fixed Angles                          Using order z-y-x

  Y                               Y


                  Z                             Z



        X                                  X
                             Orientation represented by
 Original orientation                 (0,90,0)


         Note: left-hand coordinate system
                                                          Rick Parent - CIS681
Fixed Angles
                      Using order z-y-x



   Y                  Y




                  Z                   Z
          X
                               X
       Original           (45,90,0)



                                          Rick Parent - CIS681
 Gimbal Lock
                                 Using order z-y-x
From (0,90,0), how can the
object change its orientation?
       Y                         What do these do?

                                   a) (e,90,0)

                                   b) (0,90+e,0)
                     Z

                X                  c) (0,90,e)




                                                     Rick Parent - CIS681
Fixed Angles

  (0,90,0)                        (-45,90,0)

    Y                Changing      Y
                     Z-axis
                     parameter


                 Z                             Z
                     Is same as
             X       X-axis
                                    X
                     rotation
   (0,90,0)                        (0,90,45)

                                               Rick Parent - CIS681
Fixed Angle Interpolation
           (0,90,0) to (90,0,90)
                  (0,0,0)



(0,90,0)                           (90,0,90)




                                      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.

                         Y    y




              Z

                  z          x       X

                                                        Rick Parent - CIS681
Euler Angles                                                              Use (z,y,x)

Show that Euler angle ordering                                            Y    y
is equivalent to reverse
ordering in fixed angles

P   Rz (q1 )P
                                                            Z
P   Rz (q1 )Ry (q 2 )Rz (q1 )P 
P   Rz (q1 )Ry (q 2 )Rz (q1 )Rz (q1 )P                      z             x         X
P   Rz (q1 )Ry (q 2 )P
P   Rz (q1 )Ry (q 2 )Rx (q 3 )Ry (q 2 )Rz (q1 )P 
P   Rz (q1 )Ry (q 2 )Rx (q 3 )Ry (q 2 )Rz (q1 )Rz (q1 )Ry (q 2 )P
P   Rz (q1 )Ry (q 2 )Rx (q 3 )P
                                               …and so has the same problems

                                                                                   Rick Parent - CIS681
Axis-Angle
                                         Rotate object
    (Ax,Ay,Az,q)                         by q around A
                       A

      Y                    q



Z
                   X

      Euler’s rotation theorem: An arbitrary rotation
      may be described by only three parameters.
                                                         ?

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


                                                         Rick Parent - CIS681
Quaternions
                                    Has the same information as
                                    axis-angle but in a more
                                    computational-friendly form

  q =[s,v]=[s,x,y,z]
                            A

                                q




           (cos(q/2),sin(q/2)*A)


                                                        Rick Parent - CIS681
    Quaternions
                        Basic math operations

s1    v1   s2 v 2   s1  s2 v1  v 2 
s1    v1 s2 v 2   s1s2  v1  v 2         s1v 2  s2v1  v1  v 2 
q  s2  x 2  y 2  z 2
q1 0 0 0  q

q1
      
        s        v
               2
           q
qq1  1 0 0 0
                                                                   Rick Parent - CIS681
Quaternions - rotate a point


         v = (x,y,z) => [0,v]



       Rot q (v)  v   q0 v q1




                                      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)

           Rotq (Rotp (v))  Rotq ( p0 v  p1 )
                                  qp0 v p1q1
                                  qp0 v (qp)1
                                  Rotqp (v)



 
                                                                    Rick Parent - CIS681
    Quaternion Rotation

                                     q
    Unit quaternion =>
                                    ||q||


         Rot s   v    Rot k s   v    Rot ks   kv




                  Rot s   v    Rots    v


                                                           Rick Parent - CIS681
   Quaternion Interpolation



                    Fixed angles

  (0,90,0)                          (90,0,90)


                    quaternions

                                   [0.5,0.5,0.5,0.5]
[0.7,0.0,0.7,0.0]




                                         Rick Parent - CIS681
Quaternion Interpolation
Linearly interpolating fixed               Interpolating quaternions from
  angles from (0,90,0) to               (0.5,0.0,1.0,0.0) to (0.5,0.5,0.5,0.5)
         (90,0,90)                      using sphereical linear interpolation




         QuickTime™ an d a                          QuickTime™ an d a
        Video d ecompressor                        Video d ecompressor
   are need ed to see this p icture .         are need ed to see this p icture .




                                                                               Rick Parent - CIS681

						
Related docs
Other docs by HC120914141150
Section 95
Views: 0  |  Downloads: 0
Sarah Borenstein
Views: 0  |  Downloads: 0
Program Files
Views: 0  |  Downloads: 0
FOR IMMEDIATE RELEASE
Views: 0  |  Downloads: 0
ORATORIA ROMANA
Views: 5  |  Downloads: 0
ERP Comm District tour English V2 090311
Views: 2  |  Downloads: 0