Graphics 3 D Viewing http kucg korea ac

  • Slides: 45
Download presentation
Graphics 3 D Viewing 고려대학교 컴퓨터 그래픽스 연구실 http: //kucg. korea. ac. kr Graphics

Graphics 3 D Viewing 고려대학교 컴퓨터 그래픽스 연구실 http: //kucg. korea. ac. kr Graphics Lab @ Korea University

In Pipeline KUCG 3 D Primitives Modeling Transformation Transform into 3 D World Coordinate

In Pipeline KUCG 3 D Primitives Modeling Transformation Transform into 3 D World Coordinate System Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World Coordinate System Illustrate According to Lighting and Reflectance Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Viewing Transformation Transform into 3

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Viewing Transformation Transform into 3 D World Coordinate System Illustrate According to Lighting and Reflectance Transform into 3 D Viewing Coordinate System Projection Transformation Clipping Viewport Transformation Scan Conversion Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World Coordinate System Illustrate According to Lighting and Reflectance Viewing Transformation Transform into 3 D Viewing Coordinate System Projection Transformation Transform into 2 D Viewing Coordinate System Clipping Viewport Transformation Scan Conversion Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World Coordinate System Illustrate According to Lighting and Reflectance Viewing Transformation Transform into 3 D Viewing Coordinate System Projection Transformation Transform into 2 D Viewing Coordinate System Clipping Clip Primitives outside Window’s Viewport Transformation Scan Conversion Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World Coordinate System Illustrate According to Lighting and Reflectance Viewing Transformation Transform into 3 D Viewing Coordinate System Projection Transformation Transform into 2 D Viewing Coordinate System Clipping Viewport Transformation Clip Primitives outside Window’s View Transform into Viewport Scan Conversion Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World

In Pipeline KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World Coordinate System Illustrate According to Lighting and Reflectance Viewing Transformation Transform into 3 D Viewing Coordinate System Projection Transformation Transform into 2 D Viewing Coordinate System Clipping Viewport Transformation Scan Conversion Clip Primitives outside Window’s View Transform into Viewport Draw Pixels Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Transformation KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World Coordinate

Transformation KUCG 3 D Primitives Model Transformation Lighting Transform into 3 D World Coordinate System Illustrate According to Lighting and Reflectance Viewing Transformation Transform into 3 D Viewing Coordinate System Projection Transformation Transform into 2 D Viewing Coordinate System Clipping Viewport Transformation Scan Conversion Clip Primitives outside Window’s View Transform into Viewport Draw Pixels Image http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Transformation KUCG P(x, y, z) 3 D Object Coordinate 3 D Viewing Coordinate Model

Transformation KUCG P(x, y, z) 3 D Object Coordinate 3 D Viewing Coordinate Model Transformation 3 D World Coordinate Viewing Transformation 3 D Viewing Coordinate Projection Transformation 3 D Object Coordinate 2 D Projection Coordinate Viewport Transformation 2 D Device Coordinate 3 D World Coordinate p(x’, y’) or p(u, v) http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Viewing Transformation KUCG P(x, y, z) 3 D Object Coordinate Model Transformation 3 D

Viewing Transformation KUCG P(x, y, z) 3 D Object Coordinate Model Transformation 3 D World Coordinate Viewing Transformation 3 D Viewing Coordinate Viewing Transformation Projection Transformation 2 D Projection Coordinate Viewport Transformation 2 D Device Coordinate p(x’, y’) or p(u, v) http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Camera Models n KUCG Real camera models have… Lens distortion n Motion blur n

Camera Models n KUCG Real camera models have… Lens distortion n Motion blur n Depth of field (3 D range scanner) n n Pin-hole camera n The most basic model Without lens distortion o Without motion blur o Ideal projection case o http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Viewing Parameters n Position n n KUCG Eye position (px, py, pz) Orientation View

Viewing Parameters n Position n n KUCG Eye position (px, py, pz) Orientation View direction (dx, dy, dz) n Up direction (ux, uy, uz) n n Aperture n n Field of view (xfov, yfov) View plane “look at” point n View-plane normal n http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Viewing Transformation n KUCG Mapping from world to viewing coordinates Origin moves to eye

Viewing Transformation n KUCG Mapping from world to viewing coordinates Origin moves to eye (camera) position n Up vector to Y axis n Right vector to X axis n Y Camera Z X http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Viewing Coordinate n KUCG Canonical coordinate system Convention is right-handed (looking down –z axis)

Viewing Coordinate n KUCG Canonical coordinate system Convention is right-handed (looking down –z axis) n Convention for projection, clipping, etc. n Viewing up vector maps to Y axis Y Viewing back vector maps to Z axis Z http: //kucg. korea. ac. kr X Viewing right vector maps to X axis Graphics Lab @ Korea University

Transformation from WC to VC n KUCG Transformation sequences Translate the view reference point

Transformation from WC to VC n KUCG Transformation sequences Translate the view reference point to the origin of WC n Apply rotations n o To align the xv, yv, and zv axes with the world axes yw yv xv zv yv xw zw zw yw yw xv yv zv zv x v xw xw zw General Sequence of Translate-rotate Transformation http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Transformation from WC to VC (cont’) n Translation n n KUCG View reference point

Transformation from WC to VC (cont’) n Translation n n KUCG View reference point (x 0, y 0, z 0) Rotation Rotate about the xw to bring zv into the xwzw plane n Rotate about the yw to align the zw and zv n Rotate about the zw to align the yw and yv n http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Transformation from WC to VC (cont’) n KUCG Rotation by uvn system n Calculate

Transformation from WC to VC (cont’) n KUCG Rotation by uvn system n Calculate unit uvn vectors N: view-plane normal vector o V: view-up vector o U: perpendicular to both N and V o n Form the composite rotation matrix http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Viewing Transformation KUCG P(x, y, z) 3 D Object Coordinate Model Transformation 3 D

Viewing Transformation KUCG P(x, y, z) 3 D Object Coordinate Model Transformation 3 D World Coordinate Viewing Transformation 3 D Viewing Coordinate Projection Transformation 2 D Projection Coordinate Projection Transformation Viewport Transformation 2 D Device Coordinate p(x’, y’) or p(u, v) http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Projection n General definition n n KUCG Transform points in n-space to m-space (m<n)

Projection n General definition n n KUCG Transform points in n-space to m-space (m<n) In computer graphics n Map viewing coordinates to 2 D screen coordinates http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point Top Axonometric Front Side http: //kucg. korea. ac. kr Cabinet Other Cavalier Graphics Lab @ Korea University

Parallel & Perspective n Parallel Projection n Perspective Projection http: //kucg. korea. ac. kr

Parallel & Perspective n Parallel Projection n Perspective Projection http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea University

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point Top Axonometric Front Side http: //kucg. korea. ac. kr Cabinet Other Cavalier Graphics Lab @ Korea University

Parallel Projection n KUCG Center of projection is at infinity n Direction of projection

Parallel Projection n KUCG Center of projection is at infinity n Direction of projection (DOP) o Same for all points DOP View Plane http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point Top Axonometric Front Side http: //kucg. korea. ac. kr Cabinet Other Cavalier Graphics Lab @ Korea University

Parallel Projection View Volume http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea

Parallel Projection View Volume http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea University

Orthographic & Oblique n Orthographic projection n n KUCG Perpendicular to the view plane

Orthographic & Oblique n Orthographic projection n n KUCG Perpendicular to the view plane Oblique projection n Inclined with respect to the view plane http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Orthographic Projections n KUCG DOP perpendicular to view plane Front Top http: //kucg. korea.

Orthographic Projections n KUCG DOP perpendicular to view plane Front Top http: //kucg. korea. ac. kr Side Graphics Lab @ Korea University

Orthographic Coordinates http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea University

Orthographic Coordinates http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea University

Oblique Projections n KUCG DOP not perpendicular to view plane n Specified with two

Oblique Projections n KUCG DOP not perpendicular to view plane n Specified with two angles (DOP) o o Cavalier (DOP at 45 ) http: //kucg. korea. ac. kr Cabinet (DOP at 63. 4 ) Graphics Lab @ Korea University

Oblique Projections n KUCG DOP not perpendicular to view plane n Cavalier projection n

Oblique Projections n KUCG DOP not perpendicular to view plane n Cavalier projection n Cabinet projection http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Parallel Projection Matrix n KUCG General parallel projection transformation http: //kucg. korea. ac. kr

Parallel Projection Matrix n KUCG General parallel projection transformation http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point

Taxonomy of Projections KUCG Planar geometric projection Parallel Orthographic Perspective Oblique One-point Three-point Two-point Top Axonometric Front Side http: //kucg. korea. ac. kr Cabinet Other Cavalier Graphics Lab @ Korea University

Perspective Projection n KUCG Map points Onto “view plane” n Along “projectors” n o

Perspective Projection n KUCG Map points Onto “view plane” n Along “projectors” n o Emanating from “center of projection” (COP) rs o t c je o Pr Center of Projection http: //kucg. korea. ac. kr View Plane Graphics Lab @ Korea University

Perspective Projection n KUCG How many vanishing points? http: //kucg. korea. ac. kr Graphics

Perspective Projection n KUCG How many vanishing points? http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Perspective Projection n KUCG How many vanishing points? Three-point Perspective http: //kucg. korea. ac.

Perspective Projection n KUCG How many vanishing points? Three-point Perspective http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Perspective Projection n KUCG How many vanishing points? Three-point Perspective http: //kucg. korea. ac.

Perspective Projection n KUCG How many vanishing points? Three-point Perspective http: //kucg. korea. ac. kr Two-point Perspective Graphics Lab @ Korea University

Perspective Projection n KUCG How many vanishing points? Three-point Perspective http: //kucg. korea. ac.

Perspective Projection n KUCG How many vanishing points? Three-point Perspective http: //kucg. korea. ac. kr Two-point Perspective One-point Perspective Graphics Lab @ Korea University

Perspective Projection View Volume http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea

Perspective Projection View Volume http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea University

Perspective Projection n KUCG Compute 2 D coordinates n From 3 D coordinates with

Perspective Projection n KUCG Compute 2 D coordinates n From 3 D coordinates with similar triangles http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Perspective Projection n KUCG Compute 2 D coordinates n From 3 D coordinates with

Perspective Projection n KUCG Compute 2 D coordinates n From 3 D coordinates with similar triangles http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Perspective Projection Matrix n KUCG 4 x 4 matrix representation? http: //kucg. korea. ac.

Perspective Projection Matrix n KUCG 4 x 4 matrix representation? http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Perspective Projection Matrix n KUCG 4 x 4 matrix representation? http: //kucg. korea. ac.

Perspective Projection Matrix n KUCG 4 x 4 matrix representation? http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Perspective vs. Parallel n KUCG Perspective projection + Size varies inversely with distance –

Perspective vs. Parallel n KUCG Perspective projection + Size varies inversely with distance – Looks realistic – Distance and angles are not (in general) preserved – Parallel lines do not (in general) remain parallel n Parallel projection + Good for exact measurements + Parallel lines remain parallel – Angles are not (in general) preserved – Less realistic looking http: //kucg. korea. ac. kr Graphics Lab @ Korea University

Classical Viewing http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea University

Classical Viewing http: //kucg. korea. ac. kr KUCG Graphics Lab @ Korea University