Docsity

Computer Animation - Introduction to Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Computer Animation - Introduction to Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

3D Transforms &

Computer Animation

Today

  • Discuss robot arm example from last class
  • Extend transforms to 3D
  • Aside: Talk about some principles of

computer animation

x y T 1 R 1 R 2 R 3 P Find the new location of P (P’) after some translations T1, T2, T3, T 4 and rotations R 1 , R 2 , and R3. Express in terms of a matrix product, i.e. P’ = R 1 R 2 R 3 P T 2 T 3 T 4

Robotic Arm Example

Docsity.com

x y P T 4

Robotic Arm Example

P’ P’ = T 4 P

x y

Robotic Arm Example

P’’’ = T 3 P’’ = T 3 R 3 T 4 P

P’’ T 3 P’’’

x y

Robotic Arm Example

P

4 = R 2 P’’’ = R 2 T 3 R 3 T 4 P P’’’ P 4 R 2

x y

Robotic Arm Example

P 5 P 6 R 1 P 6 = R 1 P 5 = R 1 T 2 R 2 T 3 R 3 T 4 P

x y

Robotic Arm Example

P 6 P 7 T 1 P 7 = T 1 P 6 = T 1 R 1 T 2 R 2 T 3 R 3 T 4 P

x y

Robotic Arm Example

P

7 = T 1 P 6 = T 1 R 1 T 2 R 2 T 3 R 3 T 4 P P 7 T 1 R 1 R 2 R 3 T 2 T 3 T 4

3D Transforms

x y T x y z T Pretty much exactly the same as 2D transforms

Cross Products

  • We talked about the cross product

operator in the math lecture

  • Defined as

• The cross product of 2 vectors is a

vector perpendicular to both of the other two vectors

• Wasn’t really applicable in 2D

• Note that 2 vectors can make this true

Cross Product Direction

  • The direction of the resulting vector

from a cross product can be

determined by the “right hand rule”

  • With your right hand, for P x Q
    • Point your thumb in the direction of P
    • Point your index finger in the direction of Q
    • Rotate your middle finger to be perpendicular to the thumb and index - This is the direction of P x Q

Translation in 3D

  • We will represent translation with a

matrix of the following form:

t is the x-offset u is the y-offset v is the z-offset

Scaling in 3D

  • We will represent scaling with a matrix

of the following form:

α is the scale factor in the x-direction β is the scale factor in the y-direction γ is the scale factor in the z-direction