topic 6 3d transformations
play

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


  1. Topic 6: 3D Transformations • Homogeneous 3D transformations • Scene Hierarchies • Change of basis and rotations in 3D

  2. Showtime:

  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

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

  5. 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

  6. Elementary Rotations in 3D

  7. Rotation About Arbitrary Vector?

  8. Rotation About Arbitrary Vector?

  9. Rotation About Arbitrary Vector: Construction

  10. Scene Hierarchies

  11. 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

  12. Viewing Pipeline object world camera modeling viewing projection transform transform transform cannonical view vol. 4D cannonical screen viewport cartesianize 2D transform perspective divide

  13. Topic 7: 3D Viewing • Camera Model • Orthographic projection • The world-to-camera transformation • Perspective projection • The transformation chain for 3D viewing

  14. The Pinhole Camera

  15. Camera model virtual image Ideal pinhole camera image pinhole object Real pinhole camera image aperture object

  16. Camera model Real pinhole camera image aperture object Camera with a lens aperture object

  17. Camera model Camera with a lens aperture object Depth of Field

  18. The Pinhole Camera: Basic Geometry in 2D

  19. Camera model v W u

  20. Viewing Pipeline object world camera modeling viewing projection transform transform transform cannonical view vol. 4D cannonical screen viewport cartesianize 2D transform perspective divide

  21. Viewing Transform V up P eye P ref

  22. Camera model v W u

  23. Viewing Transform V up w=(P eye -P ref )/||P eye -P ref || P eye P ref

  24. Camera model v W u

  25. Viewing Transform V up w P eye u=(V up xw)/|| V up xw || P ref

  26. Viewing Transform V up w v=wxu P eye u P ref

  27. Change-of-basis Matrix V up v=wxu P eye w u P ref

  28. Change-of-basis Matrix V up v=wxu P eye w u P ref

  29. Viewing Pipeline object world camera modeling viewing projection transform transform transform canonical view vol. 4D canonical screen viewport cartesianize 2D transform perspective divide

  30. Camera model What is the difference between these images?

  31. Camera model What is the difference between these images? Perspective Orthographic

  32. Parallel vs Perspective projection

  33. Orthographic projection p’=[x y 1] T p=[x y z 1] T

  34. 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

  35. Parallel vs Perspective projection

  36. Camera model Perspective Projection

  37. Perspective projection w v u

  38. View frustum

  39. Perspective projection w v P’ P d u

  40. Simple Perspective w v P’ P d u P(x,y,z) y P’(x’,y’,z’) z (0,0,d) Image plane

  41. Simple Perspective X Z

  42. X Z

  43. Using Homogenous Coordinates

  44. X Z

  45. X Z

  46. Homogenous Coordinate after Orthographic Projection Homogenous Coordinate after Perspective Projection

  47. Viewing volumes Projected image

  48. Transforming the View Frustim

  49. 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

  50. The orthographic view volume

  51. The orthographic view volume

  52. The orthographic view volume

  53. The orthographic view volume

  54. Homogeonous Coords and Perspective View Plane View Plane Warped to look like Camera Space Orthographic Projection

  55. Perspective Matrix

  56. Perspective Matrix

  57. Verify

  58. Verify

  59. Verify

  60. Viewing Pipeline object world camera modeling viewing projection transform transform transform canonical view vol. 4D canonical screen viewport cartesianize 2D transform perspective divide

  61. Viewport Transform

  62. Viewport Transform

  63. Viewing Pipeline object world camera modeling viewing projection transform transform transform canonical view vol. 4D canonical screen viewport cartesianize 2D transform perspective divide

  64. Viewport Transform

Recommend


More recommend