arbitrary axis rotations with vector algebra
play

Arbitrary Axis Rotations with Vector Algebra CS418 Computer Graphics - PowerPoint PPT Presentation

Arbitrary Axis Rotations with Vector Algebra CS418 Computer Graphics John C. Hart Vector Algebra Forget homogenous coordinates for the moment Simple vectors, e.g. a = ( a x , a y , a z ), b = ( b x , b y , b z ) Vector Algebra


  1. Arbitrary Axis Rotations with Vector Algebra CS418 Computer Graphics John C. Hart

  2. Vector Algebra • Forget homogenous coordinates for the moment • Simple vectors, e.g. a = ( a x , a y , a z ), b = ( b x , b y , b z )

  3. Vector Algebra • Forget homogenous coordinates for the moment • Simple vectors, e.g. a = ( a x , a y , a z ), b = ( b x , b y , b z ) 2 + a y 2 + a z 2 ) • Length: || a || = sqrt( a x • Normalizing a vector ( a /|| a ||) makes it unit length

  4. Vector Algebra • Forget homogenous coordinates for the moment • Simple vectors, e.g. a = ( a x , a y , a z ), b = ( b x , b y , b z ) 2 + a y 2 + a z 2 ) • Length: || a || = sqrt( a x • Normalizing a vector ( a /|| a ||) makes it unit length • Dot product a ⋅ b = a x b x + a y b y + a z b z = || a || || b || cos θ a ⋅ a = || a || 2

  5. Vector Algebra • Forget homogenous coordinates for the moment • Simple vectors, e.g. a = ( a x , a y , a z ), b = ( b x , b y , b z ) 2 + a y 2 + a z 2 ) • Length: || a || = sqrt( a x • Normalizing a vector ( a /|| a ||) makes it unit length • Dot product a ⋅ b = a x b x + a y b y + a z b z = || a || || b || cos θ a ⋅ a = || a || 2 • Cross product a × b = ( a y b z – a z b y , a z b x – a x b z , a x b y – a y b x ) || a × b || = || a || || b || sin θ

  6. y Arbitrary Axis Rotation p’ θ p • Rotations about x, y and z axes • Rotation * rotation = rotation v • Can rotate about any axis direction x z

  7. y Arbitrary Axis Rotation p’ θ p • Rotations about x, y and z axes • Rotation * rotation = rotation v • Can rotate about any axis direction x • Can do simply with vector algebra z – Ensure ||v|| = 1

  8. y Arbitrary Axis Rotation p’ θ p • Rotations about x, y and z axes o • Rotation * rotation = rotation v • Can rotate about any axis direction x • Can do simply with vector algebra z – Ensure ||v|| = 1 – Let o = (p ⋅ v)v

  9. y Arbitrary Axis Rotation p’ θ p a • Rotations about x, y and z axes o • Rotation * rotation = rotation v • Can rotate about any axis direction x • Can do simply with vector algebra z – Ensure ||v|| = 1 – Let o = (p ⋅ v)v – Let a = p – o

  10. y Arbitrary Axis Rotation p’ θ p a • Rotations about x, y and z axes b o • Rotation * rotation = rotation v • Can rotate about any axis direction x • Can do simply with vector algebra z – Ensure ||v|| = 1 – Let o = (p ⋅ v)v – Let a = p – o – Let b = v × a, (note that ||b||=||a||)

  11. y Arbitrary Axis Rotation p’ θ p a • Rotations about x, y and z axes b o • Rotation * rotation = rotation v • Can rotate about any axis direction x • Can do simply with vector algebra z – Ensure ||v|| = 1 – Let o = (p ⋅ v)v b – Let a = p – o p’ – Let b = v × a, (note that ||b||=||a||) θ || a ||sin θ – Then p’ = o + a cos q + b sin q p || a ||cos θ a

  12. y Arbitrary Axis Rotation p’ θ p a • Rotations about x, y and z axes b o • Rotation * rotation = rotation v • Can rotate about any axis direction x • Can do simply with vector algebra z – Ensure ||v|| = 1 – Let o = (p ⋅ v)v b – Let a = p – o p’ – Let b = v × a, (note that ||b||=||a||) θ || a ||sin θ – Then p’ = o + a cos q + b sin q • Simple solution to rotate a single point • Difficult to generate a rotation matrix p || a ||cos θ to rotate all vertices in a meshed model a

Recommend


More recommend