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

topic 7 3d transformations
SMART_READER_LITE
LIVE PREVIEW

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

Topic 7: 3D Transformations Homogeneous 3D transformations Scene Hierarchies Change of basis and rotations in 3D Representing 2D transforms as a 3x3 matrix Translate a point [x y] T by [t x t y ] T : x = 1 0 t x x y 0


slide-1
SLIDE 1

Topic 7: 3D Transformations

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

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-3
SLIDE 3

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-4
SLIDE 4

Scene Hierarchies

slide-5
SLIDE 5

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-6
SLIDE 6

Topic 8: 3D Viewing

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

Camera model

slide-8
SLIDE 8

Camera model: camera obscura

slide-9
SLIDE 9

Camera model

Ideal pinhole camera Real pinhole camera

  • bject

pinhole image virtual image

  • bject

aperture image

slide-10
SLIDE 10

Camera model

Real pinhole camera Camera with a lens

  • bject

aperture image

  • bject

aperture

slide-11
SLIDE 11

Camera model

Camera with a lens Depth of Field

  • bject

aperture

slide-12
SLIDE 12

Viewing Transform

Peye Pref Vup

slide-13
SLIDE 13

Viewing Transform

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

slide-14
SLIDE 14

Viewing Transform

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

slide-15
SLIDE 15

Viewing Transform

Peye Pref Vup w u v=wxu

slide-16
SLIDE 16

Change-of-basis Matrix

Peye Pref Vup w u v=wxu ux vx wx Peyex uy vy wy Peyey uz vz wz Peyez 0 0 0 1

slide-17
SLIDE 17

Camera model

slide-18
SLIDE 18

Camera model

What is the difference between these images?

slide-19
SLIDE 19

Camera model

What is the difference between these images?

Orthographic Perspective

slide-20
SLIDE 20

Perspective: Muller-Lyer Illusion

slide-21
SLIDE 21

Orthographic projection

p’=[x y 1]T

p’= [1 0 0 0] p [0 1 0 0] [0 0 0 1]

p=[x y z 1]T

slide-22
SLIDE 22

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-23
SLIDE 23

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-24
SLIDE 24

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 Translate(-(l+r)/2,-(t+b)/2,-(n+f)/2)) Scale(2/(r-l), 2/(t-b), 2/(f-n))

slide-25
SLIDE 25

Camera model

Perspective Projection

slide-26
SLIDE 26

Perspective projection

w u v

slide-27
SLIDE 27

Perspective projection

w u v d P P’

slide-28
SLIDE 28

Simple Perspective

w u v d P P’

y z

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

slide-29
SLIDE 29

Simple Perspective

y’= yd/z x’= xd/z z’=d y z

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

slide-30
SLIDE 30

Simple Perspective

x’ 1 0 0 0 x y’ = 0 1 0 0 y z’ 0 0 1 0 z w’ 0 0 1/d 0 1 w’= z/d y z

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

slide-31
SLIDE 31

Simple Perspective

x’ 1 0 0 0 x y’ = 0 1 0 0 y z’ 0 0 a b z w’ 0 0 1/d 0 1

Find a and b such that z’=-1 when z=d and z’=1 when z=D, where d and D are near and far clip planes.

y z

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

slide-32
SLIDE 32

Simple Perspective

x’ 1 0 0 0 x y’ = 0 1 0 0 y z’ 0 0 a b z w’ 0 0 1/d 0 1

z’=d(az+b)/z => -1=ad+b and 1=d(aD+b)/D => b=2D/(d-D) and a=(D+d)/(d(D-d))

y z

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

slide-33
SLIDE 33

Viewing volumes

Projected image

slide-34
SLIDE 34

Viewing Pipeline

modeling transform viewing transform projection transform cartesianize

perspective divide

viewport transform

  • bject

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