DOC PREVIEW
Berkeley COMPSCI 184 - Transformations and Rotations

This preview shows page 1-2-3-4-5-6 out of 19 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS-184: Computer GraphicsLecture #6: 3D Transformations andRotationsProf. James O’BrienUniversity of California, BerkeleyV2006-F-06-1.02TodayTransformations in 3DRotationsMatricesEuler anglesExponential mapsQuaternions33D TransformationsGenerally, the extension from 2D to 3D is straightforwardVectors get longer by oneMatrices get extra column and rowSVD still works the same wayScale, Translation, and Shear all basically the sameRotations get interesting 4˜A =1 0 0 tx0 1 0 ty0 0 1 tz0 0 0 1TranslationsFor 2DFor 3D˜A =1 0 tx0 1 ty0 0 15˜A =sx0 0 00 sy0 00 0 sz00 0 0 1˜A =sx0 00 sy00 0 1For 2DFor 3DScales(Axis-aligned!)6ShearsFor 2DFor 3D(Axis-aligned!)˜A =1 hxy0hyx1 00 0 1˜A =1 hxyhxz0hyx1 hyz0hzxhzy1 00 0 0 17Shears˜A =1 hxyhxz0hyx1 hyz0hzxhzy1 00 0 0 1Shears y into x8Rotations3D Rotations fundamentally more complex than in 2D2D: amount of rotation3D: amount and axis of rotation-vs-2D3D9RotationsRotations still orthonormal Preserve lengths and distance to origin3D rotations DO NOT COMMUTE!Right-hand ruleUnique matricesDet(R) = 1 != −1DO NOT COMMUTE!10Axis-aligned 3D Rotations2D rotations implicitly rotate about a third out of plane axis11Axis-aligned 3D Rotations2D rotations implicitly rotate about a third out of plane axisR =!cos(!) − sin(!)sin(!) cos(!)"R =cos(!) − sin(!) 0sin(!) cos(!) 00 0 1Note: looks same as ˜R12Axis-aligned 3D RotationsR =cos(!) − sin(!) 0sin(!) cos(!) 00 0 1R =1 0 00 cos(!) − sin(!)0 sin(!) cos(!)R =cos(!) 0 sin(!)0 1 0− sin(!) 0 cos(!)ˆxˆyˆzˆzˆxˆy12Axis-aligned 3D RotationsR =cos(!) − sin(!) 0sin(!) cos(!) 00 0 1R =1 0 00 cos(!) − sin(!)0 sin(!) cos(!)R =cos(!) 0 sin(!)0 1 0− sin(!) 0 cos(!)ˆxˆyˆz“Z is in your face”ˆzˆxˆy13Axis-aligned 3D RotationsR =cos(!) − sin(!) 0sin(!) cos(!) 00 0 1R =1 0 00 cos(!) − sin(!)0 sin(!) cos(!)R =cos(!) 0 sin(!)0 1 0− sin(!) 0 cos(!)ˆxˆyˆzˆxˆyˆzAlso right handed “Zup”14Axis-aligned 3D RotationsAlso known as “direction-cosine” matricesR =cos(!) − sin(!) 0sin(!) cos(!) 00 0 1R =1 0 00 cos(!) − sin(!)0 sin(!) cos(!)R =cos(!) 0 sin(!)0 1 0− sin(!) 0 cos(!)ˆzˆxˆy15Arbitrary RotationsCan be built from axis-aligned matrices:Result due to Euler... hence called Euler AnglesEasy to store in vectorBut NOT a vector.R = rot(x, y, z)R = Rˆz· Rˆy· Rˆx16Arbitrary RotationsR = Rˆz· Rˆy· RˆxRRˆzRˆyRˆx17Arbitrary RotationsAllows tumblingEuler angles are non-uniqueGimbal-lockMoving -vs- fixed axesReverse of each other18Exponential MapsDirect representation of arbitrary rotationAKA: axis-angle, angular displacement vectorRotate degrees about some axis Encode by length of vector!!!! = |r|ˆr19Exponential MapsGiven vector , how to get matrixMethod from text:1. rotate about x axis to put r into the x-y plane2. rotate about z axis align r with the x axis3. rotate degrees about x axis4. undo #2 and then #15. composite together rR!20Exponential MapsVector expressing a point has two parts does not change rotates like a 2D pointxrx!x!xr!xx21Exponential Maps!xx!−x⊥=ˆr × (ˆr × x)x⊥xrx!x!xrx!=ˆr × x−x⊥cos(!)x!sin(!)x!= x||+ x"sin(!) + x⊥cos(!)22x!=ˆr(ˆr · x)+sin(!)(ˆr × x)−cos(!)(ˆr × (ˆr × x))Exponential MapsRodriguez Formulaxrx!x!xrActually a minor variation ...22x!=ˆr(ˆr · x)+sin(!)(ˆr × x)−cos(!)(ˆr × (ˆr × x))Exponential MapsRodriguez Formulaxrx!x!xrActually a minor variation ...Linear in x23Exponential MapsBuilding the matrixx!= ((ˆrˆrt) + sin(!)(ˆr×) − cos(!)(ˆr×)(ˆr×))x(ˆr×) =0 − ˆrzˆryˆrz0 − ˆrx− ˆryˆrx0Antisymmetric matrix(a×)b = a × bEasy to verify by expansion24Exponential MapsAllows tumblingNo gimbal-lock!Orientations are space within !-radius ballNearly unique representation Singularities on shells at 2!Nice for interpolation25ex= 1 +x1!+x22!+x33!+ · · ·Exponential MapsWhy exponential?Recall series expansion of ex26Why exponential?Recall series expansion of Euler: what happens if you put in forei!= 1 +i!1!+−!22!+−i!33!+!44!+ · · ·Exponential Mapsexi!x=!1 +−!22!+!44!+ · · ·"+ i!!1!+−!33!+ · · ·"= cos(!) + i sin(!)27Why exponential?Exponential Mapse(ˆr×)!= I +(ˆr×)!1!+(ˆr×)2!22!+(ˆr×)3!33!+(ˆr×)4!44!+ · · ·e(ˆr×)!= I +(ˆr×)!1!+(ˆr×)2!22!+−(ˆr×)!33!+−(ˆr×)2!44!+ · · ·(ˆr×)3= −(ˆr×)But notice that:28Exponential Mapse(ˆr×)!= I +(ˆr×)!1!+(ˆr×)2!22!+−(ˆr×)!33!+−(ˆr×)2!44!+ · · ·e(ˆr×)!= (ˆr×)!!1!−!33!+ · · ·"+ I + (ˆr×)2!+!22!−!44!+ · · ·"e(ˆr×)!= (ˆr×)sin(!) + I + (ˆr×)2(1 − cos(!))29QuaternionsMore popular than exponential maps Natural extension of Due to Hamilton (1843)Interesting history Involves “hermaphroditic monsters”ei!= cos(!) + i sin(!)30i2= j2= k2= −1QuaternionsUber-Complex Numbersq = (z1, z2, z3, s) = (z, s)q = iz1+ jz2+ kz3+ si j = k ji = −kjk = i k j = −iki = j ik = − j31||q||2= z · z + s2= q · q∗QuaternionsMultiplication natural consequence of defn. ConjugateMagnitudeq · p = (zqsp+ zpsq+ zp× zq, spsq− zp· zq)q∗= (−z, s)32QuaternionsVectors as quaternionsRotations as quaternionsRotating a vectorComposing rotationsv = (v, 0)r = (ˆr sin!2, cos!2)x!= r · x · r∗r = r1· r2Compare to Exp. Map33QuaternionsNo tumblingNo gimbal-lockOrientations are “double unique”Surface of a 3-sphere in 4DNice for interpolation||r|| = 134Rotation MatricesEigen system One real eigenvalue Real axis is axis of rotationImaginary values are 2D rotation as complex numberLogarithmic formula ! = cos−1!Tr(R) − 12"(ˆr×) = ln(R) =!2 sin !(R − RT)Similar formulae as for exponential...35Rotation MatricesConsider:Columns are coordinate axes after transformation (true for general matrices)Rows are original axes in original system (not true for general matrices)!!!"#$$$%&!!!"#$$$%&=100010001zzzyzxyzyyyxxzxyxxrrrrrrrrrRI36Note:Rotation stuff in the book is a bit weak... luckily you have these nice


View Full Document

Berkeley COMPSCI 184 - Transformations and Rotations

Documents in this Course
Load more
Download Transformations and Rotations
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Transformations and Rotations and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Transformations and Rotations 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?