Topic 6: 3D Transformations Homogeneous 3D transformations Scene - - PowerPoint PPT Presentation

topic 6 3d transformations
SMART_READER_LITE
LIVE PREVIEW

Topic 6: 3D Transformations Homogeneous 3D transformations Scene - - PowerPoint PPT Presentation

Topic 6: 3D Transformations Homogeneous 3D transformations Scene Hierarchies Change of basis and rotations in 3D Showtime: Logitics Assignment 1 Due Tomorrow Assignment 2 available today/tomorrow For assignment


slide-1
SLIDE 1

Topic 6: 3D Transformations

  • Homogeneous 3D transformations
  • Scene Hierarchies
  • Change of basis and rotations in 3D
slide-2
SLIDE 2

Showtime:

slide-3
SLIDE 3

Logitics

  • Assignment 1 Due Tomorrow
  • Assignment 2 available today/tomorrow
  • For assignment questions use the bulletin board or email:
  • csc418tas@cs.toronto.edu
  • “When will your slides be online ?”
  • Today J
slide-4
SLIDE 4

Representing 2D transforms as a 3x3 matrix

Translate a point [x y]T by [tx ty]T : x’ = 1 0 tx x y’ 0 1 ty y 1 0 0 1 1 Rotate a point [x y]T by an angle t : x’ = cost -sint 0 x y’ sint cost 0 y 1 0 0 1 1 Scale a point [x y]T by a factor [sx sy]T x’ = sx 0 0 x y’ 0 sy 0 y 1 0 0 1 1

slide-5
SLIDE 5

Representing 3D transforms as a 4x4 matrix

Translate a point [x y z]T by [tx tytz]T : x’ = 1 0 0 tx x y’ 0 1 0 ty y z’ 0 0 1 tz z 1 0 0 0 1 1 Rotate a point [x y z]T by an angle t around z axis: x’ = cost -sint 0 0 x y’ sint cost 0 0 y z’ 0 0 1 0 z 1 0 0 0 1 1 Scale a point [x y z]T by a factor [sx sysz]T x’ = sx 0 0 0 x y’ 0 sy 0 0 y z’ 0 0 sz 0 z 1 0 0 0 1 1

slide-6
SLIDE 6

Elementary Rotations in 3D

slide-7
SLIDE 7

Rotation About Arbitrary Vector?

slide-8
SLIDE 8

Rotation About Arbitrary Vector?

slide-9
SLIDE 9

Rotation About Arbitrary Vector: Construction

slide-10
SLIDE 10

Scene Hierarchies

slide-11
SLIDE 11

Change of reference frame/basis matrix

x z y p a b c

  • p = apx’ + bpy’ + cpz’ + o

p = a b c o p’ 0 0 0 1 p’= a b c o p 0 0 0 1

  • 1
slide-12
SLIDE 12
slide-13
SLIDE 13

Viewing Pipeline

modeling transform viewing transform projection transform cartesianize

perspective divide

viewport transform

  • bject

world camera cannonical view vol. 4D screen cannonical 2D

slide-14
SLIDE 14

Topic 7: 3D Viewing

  • Camera Model
  • Orthographic projection
  • The world-to-camera transformation
  • Perspective projection
  • The transformation chain for 3D viewing
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17

The Pinhole Camera

slide-18
SLIDE 18

Camera model

Ideal pinhole camera Real pinhole camera

  • bject

pinhole image virtual image

  • bject

aperture image

slide-19
SLIDE 19

Camera model

Real pinhole camera Camera with a lens

  • bject

aperture image

  • bject

aperture

slide-20
SLIDE 20

Camera model

Camera with a lens Depth of Field

  • bject

aperture

slide-21
SLIDE 21

The Pinhole Camera: Basic Geometry in 2D

slide-22
SLIDE 22

Camera model

W u v

slide-23
SLIDE 23

Viewing Pipeline

modeling transform viewing transform projection transform cartesianize

perspective divide

viewport transform

  • bject

world camera cannonical view vol. 4D screen cannonical 2D

slide-24
SLIDE 24

Viewing Transform

Peye Pref Vup

slide-25
SLIDE 25

Camera model

W u v

slide-26
SLIDE 26

Viewing Transform

Peye Pref Vup w=(Peye-Pref)/||Peye-Pref||

slide-27
SLIDE 27

Camera model

W u v

slide-28
SLIDE 28

Viewing Transform

Peye Pref Vup w u=(Vupxw)/|| Vupxw ||

slide-29
SLIDE 29

Viewing Transform

Peye Pref Vup w u v=wxu

slide-30
SLIDE 30
slide-31
SLIDE 31

Change-of-basis Matrix

Peye Pref Vup w u v=wxu

slide-32
SLIDE 32

Change-of-basis Matrix

Peye Pref Vup w u v=wxu

slide-33
SLIDE 33

Viewing Pipeline

modeling transform viewing transform projection transform cartesianize

perspective divide

viewport transform

  • bject

world camera canonical view vol. 4D screen canonical 2D

slide-34
SLIDE 34

Camera model

What is the difference between these images?

slide-35
SLIDE 35

Camera model

What is the difference between these images?

Orthographic Perspective

slide-36
SLIDE 36
slide-37
SLIDE 37

Parallel vs Perspective projection

slide-38
SLIDE 38

Orthographic projection

p’=[x y 1]T p=[x y z 1]T

slide-39
SLIDE 39

Orthographic projection

p’=[x y 1]T p=[x y z 1]T q q’ Is |p-q| = |p’-q’| ? If m= (p+q)/2, Is m’ = (p’+q’)/2? m’ m

slide-40
SLIDE 40

Parallel vs Perspective projection

slide-41
SLIDE 41

Camera model

Perspective Projection

slide-42
SLIDE 42

Perspective projection

w u v

slide-43
SLIDE 43

View frustum

slide-44
SLIDE 44
slide-45
SLIDE 45

Perspective projection

w u v d P P’

slide-46
SLIDE 46

Simple Perspective

w u v d P P’

y z

P(x,y,z) P’(x’,y’,z’) Image plane (0,0,d)

slide-47
SLIDE 47

Simple Perspective

Z X

slide-48
SLIDE 48

Z X

slide-49
SLIDE 49

Using Homogenous Coordinates

slide-50
SLIDE 50

Z X

slide-51
SLIDE 51

Z X

slide-52
SLIDE 52

Homogenous Coordinate after Orthographic Projection Homogenous Coordinate after Perspective Projection

slide-53
SLIDE 53

Viewing volumes

Projected image

slide-54
SLIDE 54

Transforming the View Frustim

slide-55
SLIDE 55

Cannonical view volume

Map 3D to a cube centered at the origin of side length 2! p’ p x y z l r t b n f

slide-56
SLIDE 56

The orthographic view volume

slide-57
SLIDE 57

The orthographic view volume

slide-58
SLIDE 58

The orthographic view volume

slide-59
SLIDE 59

The orthographic view volume

slide-60
SLIDE 60

Homogeonous Coords and Perspective

View Plane View Plane Camera Space Warped to look like Orthographic Projection

slide-61
SLIDE 61

Perspective Matrix

slide-62
SLIDE 62

Perspective Matrix

slide-63
SLIDE 63

Verify

slide-64
SLIDE 64

Verify

slide-65
SLIDE 65

Verify

slide-66
SLIDE 66

Viewing Pipeline

modeling transform viewing transform projection transform cartesianize

perspective divide

viewport transform

  • bject

world camera canonical view vol. 4D screen canonical 2D

slide-67
SLIDE 67

Viewport Transform

slide-68
SLIDE 68

Viewport Transform

slide-69
SLIDE 69

Viewing Pipeline

modeling transform viewing transform projection transform cartesianize

perspective divide

viewport transform

  • bject

world camera canonical view vol. 4D screen canonical 2D

slide-70
SLIDE 70

Viewport Transform

slide-71
SLIDE 71