Rice COMP 360 - Understanding Quaternions

Unformatted text preview:

Understanding Quaternions:Rotations, Reflections, and Perspective ProjectionsRon GoldmanDepartment of Computer ScienceRice UniversityThe invention of the calculus of quaternions is a step towards the knowledge of quantities related to space which can only be compared for its importance with the invention of triple coordinates by Descartes. The ideas of this calculus, as distinguished from its operations and symbols, are fitted to be of the greatest use in all parts of science. -- Clerk Maxwell, 1869.Quaternions came from Hamilton after his really good work had been done; and, though beautifully ingenious, have been an unmixed evil to those who have touched them in any way, including Clerk Maxwell. — Lord Kelvin, 1892MotivationClassical Applications of Quaternions in Computer GraphicsProvide Compact Representations for Rotations and Reflections of Vectors in 3-DimensionsAvoid Distortions due to Floating Point Computations during RotationsEnable Key Frame Animation by Spherical Linear InterpolationCompact Representation for Rotations of Vectors in 3-Dimensions• 3× 3 Matrices -- 9 Entries• Unit Quaternions -- 4 CoefficientsAvoids Distortions due to Floating Point ComputationsProblem• After several matrix multiplications, rotation matrices may no longer be orthogonal due to floating point inaccuracies.• Non-Orthogonal matrices are difficult to renormalize.-- Leads to distortions in lengths and angles during rotation.Solution• Quaternions are easily renormalized.--q →qq avoids distortions during rotation.Key Frame Animation• Linear Interpolation between two rotation matrices  R1 and  R2 (key frames)fails to generate another rotation matrix.-- Lerp(R1,R2,t) = (1−t )R1+ tR2 -- not necessarily orthogonal matrices.• Spherical Linear Interpolation between two unit quaternions always generates a unit quaternion.-- Slerp(q1,q2,t) =sin (1−t )φ( )sin(φ)q1+sin tφ( )sin(φ)q2 -- always a unit quaternion. q1 q2 Slerp(q1,q2,t )φ(1− t)φtφAdditional Applications of Quaternions in Geometric ModelingPractical methods for tubing and texturing smooth curves and surfaces using optimal orthonormal frames [Hanson, 2006]. Better ways to visualize streamlines [Hanson, 2006]. Effective techniques for generating and analyzing 3–dimensional Pythagorean hodograph curves [Farouki, 2008].Novel constructions of curves and surface patches on spheres [Krasauskas, 2011].Efficient conformal transformations on triangular meshes [Schroder et al, 2011].Goals and Motivation• To provide a geometric interpretation for quaternions, appropriate for contemporary Computer Graphics.• To present better ways to visualize quaternions, and the effect of quaternion multiplication on points and vectors in 3-dimensions.• To develop simple, intuitive proofs of the sandwiching formulas for rotation and reflection.• To show how to apply sandwiching to compute perspective projections (NEW).PrerequisitesComplex Numbers•eiθ= cos(θ) + isin(θ)• z  eiθz rotates z by the angle θ in the complex planeVector Geometry•u ⋅v = 0!⇔!u ⊥ v•u × v ⊥ u,vModels for Visualizing 4–DimensionsMathematical Models for 4-Dimensions• Mass-Points• Vectors in 4-Dimensions• Pairs of Mutually Orthogonal PlanesMass Points and Archimedes’ Law of the Lever••Δ•m1m2m1+ m2P1P2 (m1P1,m1) + (m2P2,m2) = (m1P1+ m2P2,m1+ m2)  d1 = distm1P1+ m2P2m1+ m2, P1⎛ ⎝ ⎜ ⎞ ⎠ ⎟ = m2| P2− P1|m1+ m2d2 = distm1P1+ m2P2m1+ m2, P2⎛ ⎝ ⎜ ⎞ ⎠ ⎟ = m1| P1− P2|m1+ m2 ⇒ m1d1= m2d2Mass Points and Vectors•(mP, m)(mP, m) + (v,0) = (mP + v, m)m(v, 0)m•Addition and Subtraction for Vectors u v u + v u v u − vAddition SubtractionQuaternionsOld Definition• q = a + b i + c j + dk = a + v• Sum of a scalar and a vectorNew Definition• q = a O + bi + c j + d k = aO + v• Sum of a mass-point and a vector = a mass-point•O = (0,0, 0,1) = origin ↔ identity for quaternion multiplicationQuaternion MultiplicationNotation (Mass-Points)• q = a O + bi + c j + d k• O = identity for multiplicationMultiplication (Basis Vectors)• i2= j2= k2= −OO2= O• ij = k jk = i ki = j• ji = −k kj = −i ik = − jMultiplication (Arbitrary Quaternion)• (aO + v)(αO + w) = (aα− v ⋅w)O + (αv + aw + v × w)• vw = −(v ⋅w)O + v ×wProperties of Quaternion Multiplication• Associative• Not Commutative• Distributes Through Addition• Identity and InversesThe 4–Dimensional Vector Space of Quaternions mass Points mass = 1 • O = (0,0,0,1) Vectors mass = 0 •  O = (0,0,0,0) • (mP, m) • (P,1)(v, 0)Pairs of Complementary Orthogonal PlanesiOkjComplex Plane Orthogonal Planei2= −O, O2= Oj, k ⊥ O, iOrthogonal PlaneiOkj=∗! jOrthogonal Plane Complex Plane ∗! jj, k ⊥ O, iPairs of Complementary Orthogonal PlanesjOikComplex Plane Orthogonal Planej2= −O, O2= Ok, i ⊥ O, jOrthogonal PlanejOik=∗!kOrthogonal Plane Complex Plane ∗! kPairs of Complementary Orthogonal PlanesNON × v⊥= N v⊥v⊥Complex Plane Orthogonal PlaneN2= −O, O2= Ov⊥, N × v⊥⊥ O, NOrthogonal PlaneNON v⊥v⊥=∗!v⊥Orthogonal Plane Complex Plane ∗!v⊥The Geometry of Quaternion MultiplicationQuaternion Multiplication and IsometriesNorm of Product•|| p q ||=|| p |||| q ||Quaternion Multiplication and IsometriesNorm of Product•|| p q ||=|| p |||| q ||Multiplication by Unit Quaternions• p  pq•|| q ||=1 ⇒ multiplication by q (on left or right) is a linear isometry in R4Quaternion Multiplication and IsometriesNorm of Product•|| p q ||=|| p |||| q ||Multiplication by Unit Quaternions• p  pq•|| q ||=1 ⇒ multiplication by q (on left or right) is a linear isometry in R4⇒ multiplication by q (on left or right) is rotation in R4Properties of Vector MultiplicationVector Multiplication•v w = (−v ⋅w)O + v × wConsequences•N ⊥ v!⇒ Nv = N × v•|| N || = 1!⇒ N2= −O• O, N plane is isomorphic to the complex plane--N2= −O, O2= O--NO = O N = NVector Multiplication Introduces Mass via RotationOv × wv × wv2= −Ovw!!θv w = −cos(θ)O + sin(θ)v × wv × wθ−v ⋅w = − cos(θ)sin(θ)v∗Plane of v,wOrthogonal Plane of v × w,OMultiplication by v represents a rotation in 4-dimensionsPlanes Isomorphic to the Complex PlaneNN − axis!!!OO − axis !!!θq(N,θ) = cos(θ)O +sin(θ) Niy −


View Full Document

Rice COMP 360 - Understanding Quaternions

Documents in this Course
Radiosity

Radiosity

42 pages

Radiosity

Radiosity

22 pages

Load more
Download Understanding Quaternions
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 Understanding Quaternions 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 Understanding Quaternions 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?