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 questions use the bulletin board or email: • csc418tas@cs.toronto.edu • “When will your slides be online ?” • Today J
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 1 t y 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 [s x s y ] T x’ = s x 0 0 x y’ 0 s y 0 y 1 0 0 1 1
Representing 3D transforms as a 4x4 matrix Translate a point [x y z] T by [t x t y t z ] T : x’ = 1 0 0 t x x y’ 0 1 0 t y y z’ 0 0 1 t z 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 [s x s y s z ] T x’ = s x 0 0 0 x y’ 0 s y 0 0 y z’ 0 0 s z 0 z 1 0 0 0 1 1
Elementary Rotations in 3D
Rotation About Arbitrary Vector?
Rotation About Arbitrary Vector?
Rotation About Arbitrary Vector: Construction
Scene Hierarchies
Change of reference frame/basis matrix p c y b o x a z p = ap x ’ + bp y ’ + cp z ’ + o p = a b c o p’ 0 0 0 1 -1 p’= a b c o p 0 0 0 1
Viewing Pipeline object world camera modeling viewing projection transform transform transform cannonical view vol. 4D cannonical screen viewport cartesianize 2D transform perspective divide
Topic 7: 3D Viewing • Camera Model • Orthographic projection • The world-to-camera transformation • Perspective projection • The transformation chain for 3D viewing
The Pinhole Camera
Camera model virtual image Ideal pinhole camera image pinhole object Real pinhole camera image aperture object
Camera model Real pinhole camera image aperture object Camera with a lens aperture object
Camera model Camera with a lens aperture object Depth of Field
The Pinhole Camera: Basic Geometry in 2D
Camera model v W u
Viewing Pipeline object world camera modeling viewing projection transform transform transform cannonical view vol. 4D cannonical screen viewport cartesianize 2D transform perspective divide
Viewing Transform V up P eye P ref
Camera model v W u
Viewing Transform V up w=(P eye -P ref )/||P eye -P ref || P eye P ref
Camera model v W u
Viewing Transform V up w P eye u=(V up xw)/|| V up xw || P ref
Viewing Transform V up w v=wxu P eye u P ref
Change-of-basis Matrix V up v=wxu P eye w u P ref
Change-of-basis Matrix V up v=wxu P eye w u P ref
Viewing Pipeline object world camera modeling viewing projection transform transform transform canonical view vol. 4D canonical screen viewport cartesianize 2D transform perspective divide
Camera model What is the difference between these images?
Camera model What is the difference between these images? Perspective Orthographic
Parallel vs Perspective projection
Orthographic projection p’=[x y 1] T p=[x y z 1] T
Orthographic projection Is |p-q| = |p’-q’| ? q’ If m= (p+q)/2, Is m’ = (p’+q’)/2? m’ p’=[x y 1] T q m p=[x y z 1] T
Parallel vs Perspective projection
Camera model Perspective Projection
Perspective projection w v u
View frustum
Perspective projection w v P’ P d u
Simple Perspective w v P’ P d u P(x,y,z) y P’(x’,y’,z’) z (0,0,d) Image plane
Simple Perspective X Z
X Z
Using Homogenous Coordinates
X Z
X Z
Homogenous Coordinate after Orthographic Projection Homogenous Coordinate after Perspective Projection
Viewing volumes Projected image
Transforming the View Frustim
Cannonical view volume t Map 3D to a cube centered y f at the origin of side length 2! r x z l n p’ b p
The orthographic view volume
The orthographic view volume
The orthographic view volume
The orthographic view volume
Homogeonous Coords and Perspective View Plane View Plane Warped to look like Camera Space Orthographic Projection
Perspective Matrix
Perspective Matrix
Verify
Verify
Verify
Viewing Pipeline object world camera modeling viewing projection transform transform transform canonical view vol. 4D canonical screen viewport cartesianize 2D transform perspective divide
Viewport Transform
Viewport Transform
Viewing Pipeline object world camera modeling viewing projection transform transform transform canonical view vol. 4D canonical screen viewport cartesianize 2D transform perspective divide
Viewport Transform
Recommend
More recommend