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

arbitrary axis rotations with vector algebra
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Arbitrary Axis Rotations with Vector Algebra

CS418 Computer Graphics John C. Hart

slide-2
SLIDE 2

Vector Algebra

  • Forget homogenous coordinates for the moment
  • Simple vectors, e.g. a = (ax,ay,az), b = (bx,by,bz)
slide-3
SLIDE 3

Vector Algebra

  • Forget homogenous coordinates for the moment
  • Simple vectors, e.g. a = (ax,ay,az), b = (bx,by,bz)
  • Length: ||a|| = sqrt(ax

2 + ay 2 + az 2)

  • Normalizing a vector (a/||a||) makes it unit length
slide-4
SLIDE 4

Vector Algebra

  • Forget homogenous coordinates for the moment
  • Simple vectors, e.g. a = (ax,ay,az), b = (bx,by,bz)
  • Length: ||a|| = sqrt(ax

2 + ay 2 + az 2)

  • Normalizing a vector (a/||a||) makes it unit length
  • Dot product

a⋅b = axbx + ayby + azbz = ||a|| ||b|| cos θ a⋅a = ||a||2

slide-5
SLIDE 5

Vector Algebra

  • Forget homogenous coordinates for the moment
  • Simple vectors, e.g. a = (ax,ay,az), b = (bx,by,bz)
  • Length: ||a|| = sqrt(ax

2 + ay 2 + az 2)

  • Normalizing a vector (a/||a||) makes it unit length
  • Dot product

a⋅b = axbx + ayby + azbz = ||a|| ||b|| cos θ a⋅a = ||a||2

  • Cross product

a × b = (aybz – azby, azbx – axbz, axby – aybx) ||a × b|| = ||a|| ||b|| sin θ

slide-6
SLIDE 6

Arbitrary Axis Rotation

  • Rotations about x, y and z axes
  • Rotation * rotation = rotation
  • Can rotate about any axis direction

x y z v

θ

p p’

slide-7
SLIDE 7

Arbitrary Axis Rotation

  • Rotations about x, y and z axes
  • Rotation * rotation = rotation
  • Can rotate about any axis direction
  • Can do simply with vector algebra

– Ensure ||v|| = 1 x y z v

θ

p p’

slide-8
SLIDE 8

Arbitrary Axis Rotation

  • Rotations about x, y and z axes
  • Rotation * rotation = rotation
  • Can rotate about any axis direction
  • Can do simply with vector algebra

– Ensure ||v|| = 1 – Let o = (p⋅v)v x y z v

θ

p p’

slide-9
SLIDE 9

Arbitrary Axis Rotation

  • Rotations about x, y and z axes
  • Rotation * rotation = rotation
  • Can rotate about any axis direction
  • Can do simply with vector algebra

– Ensure ||v|| = 1 – Let o = (p⋅v)v – Let a = p – o x y z v

θ

p p’ a

slide-10
SLIDE 10

Arbitrary Axis Rotation

  • Rotations about x, y and z axes
  • Rotation * rotation = rotation
  • Can rotate about any axis direction
  • Can do simply with vector algebra

– Ensure ||v|| = 1 – Let o = (p⋅v)v – Let a = p – o – Let b = v × a, (note that ||b||=||a||) x y z v

θ

p p’ a b

slide-11
SLIDE 11

Arbitrary Axis Rotation

  • Rotations about x, y and z axes
  • Rotation * rotation = rotation
  • Can rotate about any axis direction
  • Can do simply with vector algebra

– Ensure ||v|| = 1 – Let o = (p⋅v)v – Let a = p – o – Let b = v × a, (note that ||b||=||a||) – Then p’ = o + a cos q + b sin q x y z v

θ

p p’ a b a b

θ

p p’

||a||cosθ ||a||sinθ

slide-12
SLIDE 12

Arbitrary Axis Rotation

  • Rotations about x, y and z axes
  • Rotation * rotation = rotation
  • Can rotate about any axis direction
  • Can do simply with vector algebra

– Ensure ||v|| = 1 – Let o = (p⋅v)v – Let a = p – o – Let b = v × a, (note that ||b||=||a||) – Then p’ = o + a cos q + b sin q

  • Simple solution to rotate a single point
  • Difficult to generate a rotation matrix

to rotate all vertices in a meshed model x y z v

θ

p p’ a b a b

θ

p p’

||a||cosθ ||a||sinθ