viewing3d pipeline

3,380 views

Published on

Its Computer Graphics Topic in Engineering for Mumbai University.

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,380
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
203
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

viewing3d pipeline

  1. 1. 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr
  2. 2. 3d Rendering Pipeline cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion 3D Primitives Image This is a pipelined sequence of operations to draw a 3D primitive into a 2D image for direct illumination
  3. 3. In Pipeline <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image 3D Primitives
  4. 4. In Pipeline <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image <ul><ul><li>Illustrate according to lighting and reflectance </li></ul></ul>3D Primitives
  5. 5. In Pipeline <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image <ul><ul><li>Illustrate according to lighting and reflectance </li></ul></ul><ul><ul><li>Transform into 3D viewing coordinate system </li></ul></ul>3D Primitives
  6. 6. In Pipeline <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image <ul><ul><li>Illustrate according to lighting and reflectance </li></ul></ul><ul><ul><li>Transform into 3D viewing coordinate system </li></ul></ul><ul><ul><li>Transform into 2D viewing coordinate system </li></ul></ul>3D Primitives
  7. 7. In Pipeline <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image <ul><ul><li>Illustrate according to lighting and reflectance </li></ul></ul><ul><ul><li>Transform into 3D viewing coordinate system </li></ul></ul><ul><ul><li>Transform into 2D viewing coordinate system </li></ul></ul><ul><ul><li>Clip primitives outside window’s view </li></ul></ul>3D Primitives
  8. 8. In Pipeline <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image <ul><ul><li>Illustrate according to lighting and reflectance </li></ul></ul><ul><ul><li>Transform into 3D viewing coordinate system </li></ul></ul><ul><ul><li>Transform into 2D viewing coordinate system </li></ul></ul><ul><ul><li>Clip primitives outside window’s view </li></ul></ul><ul><ul><li>Transform into viewport </li></ul></ul>3D Primitives
  9. 9. In Pipeline <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image <ul><ul><li>Illustrate according to lighting and reflectance </li></ul></ul><ul><ul><li>Transform into 3D viewing coordinate system </li></ul></ul><ul><ul><li>Transform into 2D viewing coordinate system </li></ul></ul><ul><ul><li>Clip primitives outside window’s view </li></ul></ul><ul><ul><li>Transform into viewport </li></ul></ul><ul><ul><li>Draw pixels(includes texturing, hidden surface etc.) </li></ul></ul>3D Primitives
  10. 10. Transformation <ul><ul><li>Transform into3d world coordinate system </li></ul></ul>cgvr.korea.ac.kr Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image <ul><ul><li>Illustrate according to lighting and reflectance </li></ul></ul><ul><ul><li>Transform into 3D viewing coordinate system </li></ul></ul><ul><ul><li>Transform into 2D viewing coordinate system </li></ul></ul><ul><ul><li>Clip primitives outside window’s view </li></ul></ul><ul><ul><li>Transform into viewport </li></ul></ul><ul><ul><li>Draw pixels(includes texturing, hidden surface etc.) </li></ul></ul>3D Primitives
  11. 11. Transformation cgvr.korea.ac.kr <ul><ul><li>3D Object Coordinate </li></ul></ul>Model Transformation Viewing Transformation Projection Transformation Viewport Transformation p(x’, y’) P(x, y, z) <ul><ul><li>3D World Coordinate </li></ul></ul><ul><ul><li>3D Viewing Coordinate </li></ul></ul><ul><ul><li>2D Projection Coordinate </li></ul></ul><ul><ul><li>2D Device Coordinate </li></ul></ul>3D Viewing Coordinate 3D Object Coordinate 3D World Coordinate
  12. 12. Viewing Transformation cgvr.korea.ac.kr <ul><ul><li>3D Object Coordinate </li></ul></ul>Model Transformation Viewing Transformation Projection Transformation Viewport Transformation p(x’, y’) P(x, y, z) <ul><ul><li>3D World Coordinate </li></ul></ul><ul><ul><li>Viewing </li></ul></ul><ul><ul><li>Transformation </li></ul></ul><ul><ul><li>3D Viewing Coordinate </li></ul></ul><ul><ul><li>2D Projection Coordinate </li></ul></ul><ul><ul><li>2D Device Coordinate </li></ul></ul>
  13. 13. Viewing Transformation <ul><li>Mapping from world to Viewing coordinates </li></ul><ul><ul><li>Origin moves to eye position </li></ul></ul><ul><ul><li>Up vector maps to Y axis </li></ul></ul><ul><ul><li>Right vector maps to X axis </li></ul></ul>cgvr.korea.ac.kr X Y Z <ul><ul><li>Camera </li></ul></ul>
  14. 14. Transformation from WC to VC <ul><li>Transformation sequences </li></ul><ul><ul><li>1. Translate the view reference point to the origin of the WC system </li></ul></ul><ul><ul><li>2. Apply rotations to align the x v , y v , and z v axes with the world axes </li></ul></ul>cgvr.korea.ac.kr General sequence of translate-rotate transformation
  15. 15. Transformation from WC to VC (cont’) <ul><li>Translation </li></ul><ul><ul><li>view reference point(x 0 , y 0 , z 0 ) </li></ul></ul><ul><li>Rotation </li></ul><ul><ul><li>rotate around the world x w axis to bring z v into the x w z w plane </li></ul></ul><ul><ul><li>rotate around the world y w axis to align the z w and z v axis </li></ul></ul><ul><ul><li>final rotation is about the z w axis to align the y w and y v axis </li></ul></ul>cgvr.korea.ac.kr
  16. 16. Transformation from WC to VC (cont’) <ul><li>Rotation by uvn system </li></ul><ul><ul><li>Calculate unit uvn vectors </li></ul></ul><ul><ul><ul><li>N : view-plane normal vector </li></ul></ul></ul><ul><ul><ul><li>V : view-up vector </li></ul></ul></ul><ul><ul><ul><li>U : perpendicular to both N and V </li></ul></ul></ul><ul><ul><li>Form the composite rotation matrix </li></ul></ul>cgvr.korea.ac.kr
  17. 17. Camera Models <ul><li>The most common model is pin-hole camera </li></ul><ul><ul><li>All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus) </li></ul></ul><ul><ul><li>Sensor response proportional to radiance </li></ul></ul><ul><ul><li>Other models consider… </li></ul></ul><ul><ul><ul><li>Depth of field </li></ul></ul></ul><ul><ul><ul><li>Motion blur </li></ul></ul></ul><ul><ul><ul><li>Lens distortion </li></ul></ul></ul>cgvr.korea.ac.kr
  18. 18. Viewing Parameters <ul><li>Position </li></ul><ul><ul><li>Eye position(px, py, pz) </li></ul></ul><ul><li>Orientation </li></ul><ul><ul><li>View direction(dx, dy, dz) </li></ul></ul><ul><ul><li>Up direction(ux, uy, uz) </li></ul></ul><ul><li>Aperture </li></ul><ul><ul><li>Field of view(xfov, yfov) </li></ul></ul><ul><li>Film plane </li></ul><ul><ul><li>“ look at” point </li></ul></ul><ul><ul><li>View plane normal </li></ul></ul>cgvr.korea.ac.kr
  19. 19. Viewing Coordinate <ul><li>Canonical coordinate system </li></ul><ul><ul><li>Convention is right-handed (looking down – z axis) </li></ul></ul><ul><ul><li>Convention for projection, clipping, etc. </li></ul></ul>cgvr.korea.ac.kr X Y <ul><ul><li>Viewing up vector maps to Y axis </li></ul></ul>Viewing right vector maps to X axis Viewing back vector maps to Z axis (potting out of page)
  20. 20. Viewing Transformation <ul><li>Transformation matrix maps camera basis vectors to canonical vectors in viewing coordinate system </li></ul>cgvr.korea.ac.kr Right Up Back Eye (0, 0, 1) (0, 1, 0) (1, 0, 0) Matrix
  21. 21. Viewing Transformation cgvr.korea.ac.kr <ul><ul><li>3D Object Coordinate </li></ul></ul>Model Transformation Viewing Transformation Projection Transformation Viewport Transformation p(x’, y’) P(x, y, z) <ul><ul><li>3D World Coordinate </li></ul></ul><ul><ul><li>Projection </li></ul></ul><ul><ul><li>Transformation </li></ul></ul><ul><ul><li>3D Viewing Coordinate </li></ul></ul><ul><ul><li>2D Projection Coordinate </li></ul></ul><ul><ul><li>2D Device Coordinate </li></ul></ul>
  22. 22. Projection <ul><li>General definition </li></ul><ul><ul><li>Transform points in n-space to m-space(m<n) </li></ul></ul><ul><li>In computer graphics </li></ul><ul><ul><li>Map viewing coordinates to 2D screen coordinates </li></ul></ul>cgvr.korea.ac.kr
  23. 23. Taxonomy of Projections cgvr.korea.ac.kr Planar geometric projection Parallel Perspective Orthographic Oblique Top Front Side Axonometric Cabinet Cavalier Other One-point Two-point Three-point
  24. 24. Parallel & Perspective <ul><li>Parallel Projection </li></ul><ul><li>Perspective Projection </li></ul>cgvr.korea.ac.kr
  25. 25. Taxonomy of Projections cgvr.korea.ac.kr Planar geometric projection Parallel Perspective Orthographic Oblique Top Front Side Axonometric Cabinet Cavalier Other One-point Two-point Three-point
  26. 26. Parallel Projection <ul><li>Center of projection is at infinity </li></ul><ul><ul><li>Direction of projection (DOP) same for all points </li></ul></ul>cgvr.korea.ac.kr View Plane DOP
  27. 27. Taxonomy of Projections cgvr.korea.ac.kr Planar geometric projection Parallel Perspective Orthographic Oblique Top Front Side Axonometric Cabinet Cavalier Other One-point Two-point Three-point
  28. 28. Parallel Projection View Volume cgvr.korea.ac.kr
  29. 29. Orthographic & Oblique <ul><li>Orthographic parallel projection </li></ul><ul><ul><li>the projection is perpendicular to the view plane </li></ul></ul><ul><li>Oblique parallel projection </li></ul><ul><ul><li>The projectors are inclined with respect to the view plane </li></ul></ul>cgvr.korea.ac.kr
  30. 30. Orthographic Projections <ul><li>DOP perpendicular to view plane </li></ul>cgvr.korea.ac.kr
  31. 31. Orthographic Projections <ul><li>DOP perpendicular to view plane </li></ul>cgvr.korea.ac.kr Front Top Side
  32. 32. Orthographic Coordinates cgvr.korea.ac.kr
  33. 33. Oblique Projections <ul><li>DOP not perpendicular to view plane </li></ul>cgvr.korea.ac.kr <ul><ul><li>Cavalier </li></ul></ul><ul><ul><li>(DOP at 45 ) </li></ul></ul><ul><ul><li>Cabinet </li></ul></ul><ul><ul><li>(DOP at 63.4 ) </li></ul></ul>
  34. 34. Oblique Projections <ul><li>DOP not perpendicular to view plane </li></ul><ul><ul><li>Cavalier projection </li></ul></ul><ul><ul><li>Cabinet projection </li></ul></ul>cgvr.korea.ac.kr
  35. 35. Parallel Projection Matrix <ul><li>General parallel projection transformation </li></ul>cgvr.korea.ac.kr Where L 1 is the inverse of tan α , which is also the value of L when z =1
  36. 36. Parallel Projection Matrix <ul><li>General parallel projection transformation </li></ul>cgvr.korea.ac.kr
  37. 37. Parallel Projection Matrix cgvr.korea.ac.kr
  38. 38. Taxonomy of Projections cgvr.korea.ac.kr Planar geometric projection Parallel Perspective Orthographic Oblique Top Front Side Axonometric Cabinet Cavalier Other One-point Two-point Three-point
  39. 39. Perspective Projection <ul><li>Map points onto “view plane” along “projectors” emanating from “center of projection”(cop) </li></ul>cgvr.korea.ac.kr View Plane Center of Projection Projectors
  40. 40. Perspective Projection <ul><li>How many vanishing point? </li></ul>cgvr.korea.ac.kr
  41. 41. Perspective Projection <ul><li>How many vanishing point? </li></ul>cgvr.korea.ac.kr Three-point perspective
  42. 42. Perspective Projection <ul><li>How many vanishing point? </li></ul>cgvr.korea.ac.kr Three-point perspective Two-point perspective
  43. 43. Perspective Projection <ul><li>How many vanishing point? </li></ul>cgvr.korea.ac.kr Three-point perspective Two-point perspective One-point perspective
  44. 44. Perspective Projection View Volume cgvr.korea.ac.kr
  45. 45. Perspective Projection <ul><li>Compute 2D coordinates from 3D coordinates with similar triangles </li></ul>cgvr.korea.ac.kr
  46. 46. Perspective Projection <ul><li>Compute 2D coordinates from 3D coordinates with similar triangles </li></ul>cgvr.korea.ac.kr
  47. 47. Perspective Projection Matrix <ul><li>4x4 matrix representation? </li></ul>cgvr.korea.ac.kr
  48. 48. Perspective Projection Matrix <ul><li>4x4 matrix representation? </li></ul>cgvr.korea.ac.kr
  49. 49. Perspective Projection Matrix cgvr.korea.ac.kr Perspective projection Perspective transformation Orthographic projection Center of Projection on the x axis Center of Projection on the y axis
  50. 50. Perspective Projection Matrix cgvr.korea.ac.kr 2-point perspectives 3-point perspectives
  51. 51. Taxonomy of Projections cgvr.korea.ac.kr Planar geometric projection Parallel Perspective Orthographic Oblique Top Front Side Axonometric Cabinet Cavalier Other One-point Two-point Three-point
  52. 52. Perspective vs. Parallel <ul><li>Perspective projection </li></ul><ul><ul><li>+ Size varies inversely with distance – looks realistic </li></ul></ul><ul><ul><li>– Distance and angles are not(in general) preserved </li></ul></ul><ul><ul><li>– Parallel line do not (in general) remain parallel </li></ul></ul><ul><li>Parallel projection </li></ul><ul><ul><li>+ Good for exact measurements </li></ul></ul><ul><ul><li>+ Parallel lines remain parallel </li></ul></ul><ul><ul><li>– Angles are not (in general) preserved </li></ul></ul><ul><ul><li>– Less realistic looking </li></ul></ul>cgvr.korea.ac.kr
  53. 53. Classical Viewing cgvr.korea.ac.kr

×