lecture 2 - model transformations (rotations, scaling, - - PowerPoint PPT Presentation

lecture 2 model transformations rotations scaling
SMART_READER_LITE
LIVE PREVIEW

lecture 2 - model transformations (rotations, scaling, - - PowerPoint PPT Presentation

lecture 2 - model transformations (rotations, scaling, translation) - intro to homogeneous coordinates 2D Rotation Two ways to think about R. 1) R rotates points within a fixed coordinate frame ("world coordinates") 2) R


slide-1
SLIDE 1

lecture 2

  • model transformations

(rotations, scaling, translation)

  • intro to homogeneous coordinates
slide-2
SLIDE 2
slide-3
SLIDE 3

2D Rotation

slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6

Two ways to think about R. 1) R rotates points within a fixed coordinate frame ("world coordinates")

slide-7
SLIDE 7

2) R maps to a new coordinate system by projecting onto new axes.

slide-8
SLIDE 8

How will rotations be used? 1) re-orient an object ("model") 2) map from world coordinates to camera coordinates ("view")

slide-9
SLIDE 9

3D Rotations

slide-10
SLIDE 10

counter-clockwise (assuming eye is looking in the -z direction and the coordinates are righthanded) Example: rotate about z axis

slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26

Problem Example 4 Find a rotation matrix that rotates by  around an axis p and that is composed of a sequence

  • f rotations only around axes x, y, z.

Example solution: (think this through for yourself )

  • 1. Rotate around x axis to bring p to the xy plane.
  • 2. Rotate around z axis to bring p to the y axis.
  • 3. Rotate by around y axis.
  • 4. Apply inverse rotation of 2.
  • 5. Apply inverse rotation of 1.
slide-27
SLIDE 27

ASIDE: Representations of rotations

(very important for Computer Animation)

1) Axis-Angle -> OpenGL's glRotate() 2) Euler angles (Rz Rx Ry) 3) Quaternions

https://www.youtube.com/watch?v=syQnn_xuB8U&list=PL2y2aRaUaygU2zXme_Z11GyJUslwgaeUD https://www.youtube.com/watch?v=zc8b2Jo7mno

slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33

This is called a "homogeneous coordinates" representation. Trick: use a 4th coordinate.

slide-34
SLIDE 34

In computer graphics, we always use a 4D representation to transform points. rotation scaling

slide-35
SLIDE 35

Homogeneous Coordinates We represent (x,y, z) by (x, y, z, 1). Now define an equivalence: (x, y, z, 1 ) (w x, wy, wz, w) for any w 0. This takes each line { (wx, wy, wz, w) } in R^4 and associates it with the 3D point (x, y, z).

slide-36
SLIDE 36

Careful:

The above is an abuse of notation. It is meant to express that:

slide-37
SLIDE 37
slide-38
SLIDE 38
slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42