Repreentation and Tranformation Objective Derive homogeneou coordinate tranformation matrice Introduce tandard tranformation - Rotation - Tranlation - Scaling - Shear
Scalar, Point, Vector Three baic element from geometry: Scalar, Point, Vector Scalar can be defined a member of a et which can be combined by the operation of addition and multiplication and obey the fundamental axiom: aociativity, commutivity, inverion Example include the real and complex number under the rule we are all familiar with Scalar alone have no geometric propertie Scalar, Point, Vector A vector i a quantity with two attribute direction & magnitude and it own rule a we aw lat lecture The et define a vector pace But, vector lack poition Same length and magnitude -> Vector are inufficient to pecify geometry We need point 4
Point and Vector Point, we know, are location in pace Certain operation tranlate between point and vector - Point-point ubtraction yield a vector - Lead to equivalent to point-vector addition v=p-q P=v+Q 5 Vector Space Conider a bai v, v,., v n A vector i written v= v + v +.+ n v n The lit of calar {,,. n } then i the repreentation of v with repect to the given bai And we write the repreentation a a row or column array of calar a=[. n ] T =. n 6
Affine Space Vector pace do not repreent point Intead, we work in an affine pace and add a pecial point, the origin, to the bai vector, thi i called a frame v P v v 7 Affine Space An affine pace i both point and vector pace It allow operation from vector, point and calar: - Vector-vector addition - Scalar-vector multiplication - Point-vector addition - All calar-calar operation Define our pace with a coordinate Frame 8 4
Affine Space A frame i determined by (P, v, v, v,... ) Within thi frame: Every vector can be written a v= v + v +.+ n v n And every point can be written a P = P + v + v +.+ n v n 9 Homogeneou Coordinate Conider the point and the vector P = P + v + v +.+ n v n v= v + v +.+ n v n They appear to have the imilar repreentation p=[ ] v=[ ] v which confue the point with the vector p But, a vector ha no poition v can be placed anywhere fixed 5
Homogeneou Coordinate An affine pace ditinguihe point and vector with ( )( P ) = P ( )( P ) = (zero vector) Homogeneou Coordinate With thee rule, we can keep track of the difference: v= v + v + v = [ ][v v v P ] T P = P + v + v + v = [ ][v v v P ] T Thu we obtain a four-dimenional repreentation for both: v = [ ] T p = [ ] T 6
Homogeneou Coordinate Homogeneou coordinate are key to all computer graphic ytem Hardware pipeline all work with 4 dimenional repreentation All tandard tranformation (rotation, tranlation, caling) can be implemented by matrix multiplication with 4 x 4 matrice Homogeneou Coordinate Mot generally, the form of homogeneou coordinate i p=[x y z w] T We can return to a imple three dimenional point by x'x/w y'y/w z'z/w But if w=, the repreentation i that of a vector 4 7
Tranformation A tranformation map point to other point and/or vector to other vector v=t(u) Q=T(P) 5 Affine Tranformation Line preerving Characteritic of many phyically important tranformation - Rigid body tranformation: rotation, tranlation - Non-rigid: Scaling, hear Importance in graphic i that we need only tranform vertice (point) of line egment and polygon, then ytem draw between the tranformed point 6 8
Tranlation Move (tranlate, diplace) a point to a new location P P d Diplacement determined by a vector d - Three degree of freedom -P =P+d 7 Moving object When we move a point on an object to a new location, to preerve the object, we mut move all other point on the object in the ame way object tranlation: every point diplaced by the ame vector, d 8 9
Tranlation Uing Repreentation Uing the homogeneou coordinate repreentation in ome frame p=[ x y z ] T p =[x y z ] T d=[dx dy dz ] T Hence p = p + d or x =x+d x y =y+d y z =z+d z note that thi expreion i in four dimenion and expree that point = vector + point 9 Tranlation Matrix We can alo expre tranlation uing a 4 x 4 matrix T in homogeneou coordinate p =Tp where dx d T = T(d x, d y, d z ) = y dz Thi form i better for implementation becaue all affine tranformation can be expreed thi way and multiple tranformation can be concatenated together
Rotation (D) Conider rotation about the origin by degree - radiu tay the ame, angle increae by What i thi rotation about the z axi? Rotation (D) Conider rotation about the origin by degree - radiu tay the ame, angle increae by x = r co ( y = r in ( x =x co y in y = x in + y co x = r co y = r in
Rotation about the z axi Rotation about z axi in three dimenion leave all point with the ame z - Equivalent to rotation in two dimenion in plane of contant z x =x co y in y = x in + y co z =z - or in matrix notation (with p a a column) p =R z ()p Rotation Matrix Homogeneou Coordinate: R = R z () = co in in co 4
Rotation about x and y axe Same argument a for rotation about z axi - For rotation about x axi, x i unchanged - For rotation about y axi, y i unchanged co - in R = R x () = in co R = R y () = co - in in co 5 Scaling Expand or contract along each axi (fixed point of origin) x = x x y = y y z = z z p =Sp S = S( x, y, z ) = x y z 6
Reflection correpond to negative cale factor x = - y = original x = - y = - x = y = - 7 Shear Helpful to add one more baic tranformation Equivalent to pulling face in oppoite direction 8 4
Shear Matrix Conider imple hear along x axi x = x + y h y y = y z = z H() = hy 9 Invere Although we could compute invere matrice by general formula, we can alo ue imple geometric obervation, for example: - Tranlation: T - (d x, d y, d z ) = T(-d x, -d y, -d z ) - Rotation: R - () = R(-) Hold for any rotation matrix Note that ince co(-) = co() and in(-)= -in() R - () = R T () - Scaling: S - ( x, y, z ) = S(/ x, / y, / z ) 5
Compoite In modeling, we often tart with a imple object centered at the origin, oriented with the axi, and at a tandard ize We apply an compoite tranformation to it vertice to Scale Orient Locate Compoite Tranformation Scaling about a fixed point - Simply applying the cale tranformation alo move the object being caled. Q Q' P P' 6
Compoite Tranformation Scaling about origin doe not move object Origin i a fixed point for the cale tranformation We ue compoite tranformation to create cale tranformation with different fixed point Q Q' P P' Compoite Tranformation Fixed point cale tranformation Move fixed point (px,py,pz) to origin Scale by deired amount Move fixed point back to original poition M = T(px, py, pz) S( x, y, z ) T(-px, -py, -pz) 4 7
Compoite Tranformation Rotating about a fixed point - baic rotation alone will rotate about origin but we want: 5 Compoite Tranformation Rotating about a fixed point Move fixed point (px,py,pz) to origin Rotate by deired amount Move fixed point back to original poition M = T(px, py, pz) R x () T(-px, -py, -pz) 6 8
Compoite Tranformation 7 Compoite tranformation A erie of tranformation on an object can be applied a a erie of matrix multiplication : poition in the global coordinate : poition in the local coordinate 8 9
Interpolation In order to move thing, we need both tranlation and rotation Interpolating the tranlation i eay, but what about rotation? 9 Interpolation of orientation How about interpolating each entry of the rotation matrix? The interpolated matrix might no longer be orthonormal, leading to nonene for the in-between rotation 4
Interpolation of orientation Example: interpolate linearly from a poitive 9 degree rotation about y axi to a negative 9 degree rotation about y Linearly interpolate each component and halfway between, you get thi... 4 Motivation Finding the mot natural and compact way to preent rotation and orientation Orientation interpolation which reult in a natural motion A cloed mathematical form that deal with rotation and orientation (expanion for the complex number) 4
Repreenting Rotation Rotation matrix Euler angle Axi angle Quaternion Exponential map 4 Joint and rotation Rotational DOF are widely ued in character animation tranlational DOF 48 rotational DOF Each joint can have up to DOF DOF: knee DOF: writ DOF: arm 44
Euler Angle Repreentation Angle ued to rotate about cardinal axe Orientation are pecified by a et of ordered parameter that repreent ordered rotation about axe, ie. firt about x, then y, then z Many poible ordering, don t have to ue all axe, but can t do the ame axi back to back 45 Euler Angle A general rotation i a combination of three elementary rotation: around the x-axi (x-roll), around the y-axi (y-pitch) and around the z-axi (zyaw). 46
4 47 Euler Angle and Rotation Matrice co in in co ) ( co in in co ) pitch( y - co in in co ) ( yaw z roll x ),, ( c c c c c c c c c c c c c c R 48 Gimbal Lock A 9 degree rotation about the y axi eentially make the firt axi of rotation align with the third. Incremental change in x,z produce the ame reult you ve lot a degree of freedom
Gimbal Lock Phenomenon of two rotational axi of an object pointing in the ame direction. Reult: Loe a degree of freedom (DOF) 49 Gimbal Lock A Gimbal i a hardware implementation of Euler angle ued for mounting gyrocope or expenive globe Gimbal lock i a baic problem with repreenting D rotation uing Euler angle or fixed angle 5 5
Euler angle interpolation y π x z x-roll π y x z R(,,),,R(t,,),,R(,,) t[,] y π x z y-pitch π y π x z z-yaw π y x z R(,,),,R(,t, t),,r(,, ) 5 Euler Angle Interpolation Unnatural movement! 5 6
Repreenting Rotation Rotation matrix Euler angle Axi angle Quaternion Exponential map 5 Axi angle Repreent orientation a a vector and a calar - vector i the axi to rotate about - calar i the angle to rotate by 54 7
Angle and Axi Any orientation can be repreented by a 4-tuple - angle, vector(x,y,z) where the angle i the amount to rotate by and the vector i the axi to rotate about Can interpolate the angle and axi eparately No gimbal lock problem! But, can t efficiently compoe rotation mut convert to matrice firt! 55 Repreenting Rotation Rotation matrix Euler angle Axi angle Quaternion Exponential map 56 8
Quaternion Extenion of imaginary number Require one real and three imaginary component i, j, k q=q +q i+q j+q k 57 Quaternion Extenion of imaginary number Require one real and three imaginary component i, j, k q = (w, x, y, z) = co + in x, y, z ] of axi 58 9
Quaternion interpolation Quaternion can expre rotation on unit phere moothly and efficiently. -angle rotation can be repreented by a unit circle -angle rotation can be repreented by a unit phere Interpolation mean moving on n-d phere Now imagine a 4-D phere for -angle rotation Quaternion interpolation Moving between two point on the 4D unit phere - a unit quaternion at each tep - another point on the 4D unit phere - move along the great circle between the two point on the 4D unit phere a an arc 6
Quaternion interpolation Spherical linear interpolation (SLERP) Proce: -Rotation matrix quaternion -Carry out lerp/operation with quaternion -Quaternion rotation matrix 6 Matrix form 6
Summary Quaternion point on a 4D unit hyperphere + better interpolation + almot unique - le intuitive 6 Quaternion Math Unit quaternion Multiplication 64
Quaternion Rotation If i a unit quaternion and then reult in rotating about by proof: ee Quaternion by Shoemaker 65 Chooe a repreentation Chooe the bet repreentation for the tak - input: - joint limit: - interpolation: - compoiting: - rendering: Euler angle Euler angle, quaternion (harder) quaternion or exponential map quaternion or orientation matrix orientation matrix ( quaternion can be repreented a matrix a well) 66