550 likes | 733 Views
3D Viewing. 3d Rendering Pipeline. 3D Primitives. Model Transformation. Lighting. Viewing Transformation. This is a pipelined sequence of operations to draw a 3D primitive into a 2D image for direct illumination. Projection Transformation. Clipping. Viewport Transformation.
E N D
3d Rendering Pipeline 3D Primitives Model Transformation Lighting Viewing Transformation This is a pipelined sequence of operations to draw a 3D primitive into a 2D image for direct illumination Projection Transformation Clipping Viewport Transformation Scan Conversion Image
In Pipeline 3D Primitives Transform into3d world coordinate system Model Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image
In Pipeline 3D Primitives Transform into3d world coordinate system Model Transformation Illustrate according to lighting and reflectance Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image
In Pipeline 3D Primitives Transform into3d world coordinate system Model Transformation Illustrate according to lighting and reflectance Lighting Transform into 3D viewing coordinate system Viewing Transformation Projection Transformation Clipping Viewport Transformation Scan Conversion Image
In Pipeline 3D Primitives Transform into3d world coordinate system Model Transformation Illustrate according to lighting and reflectance Lighting Transform into 3D viewing coordinate system Viewing Transformation Transform into 2D viewing coordinate system Projection Transformation Clipping Viewport Transformation Scan Conversion Image
In Pipeline 3D Primitives Transform into3d world coordinate system Model Transformation Illustrate according to lighting and reflectance Lighting Transform into 3D viewing coordinate system Viewing Transformation Transform into 2D viewing coordinate system Projection Transformation Clip primitives outside window’s view Clipping Viewport Transformation Scan Conversion Image
In Pipeline 3D Primitives Transform into3d world coordinate system Model Transformation Illustrate according to lighting and reflectance Lighting Transform into 3D viewing coordinate system Viewing Transformation Transform into 2D viewing coordinate system Projection Transformation Clip primitives outside window’s view Clipping Transform into viewport Viewport Transformation Scan Conversion Image
In Pipeline 3D Primitives Transform into3d world coordinate system Model Transformation Illustrate according to lighting and reflectance Lighting Transform into 3D viewing coordinate system Viewing Transformation Transform into 2D viewing coordinate system Projection Transformation Clip primitives outside window’s view Clipping Transform into viewport Viewport Transformation Draw pixels(includes texturing, hidden surface etc.) Scan Conversion Image
Transformation 3D Primitives Transform into3d world coordinate system Model Transformation Illustrate according to lighting and reflectance Lighting Transform into 3D viewing coordinate system Viewing Transformation Transform into 2D viewing coordinate system Projection Transformation Clip primitives outside window’s view Clipping Transform into viewport Viewport Transformation Draw pixels(includes texturing, hidden surface etc.) Scan Conversion Image
Transformation P(x, y, z) 3D Object Coordinate 3D Viewing Coordinate Model Transformation 3D World Coordinate Viewing Transformation 3D Viewing Coordinate Projection Transformation 3D Object Coordinate 2D Projection Coordinate ViewportTransformation 3D World Coordinate 2D Device Coordinate p(x’, y’)
Viewing Transformation P(x, y, z) 3D Object Coordinate Model Transformation 3D World Coordinate Viewing Transformation Viewing Transformation 3D Viewing Coordinate Projection Transformation 2D Projection Coordinate Viewport Transformation 2D Device Coordinate p(x’, y’)
Viewing Transformation • Mapping from world to Viewing coordinates • Origin moves to eye position • Up vector maps to Y axis • Right vector maps to X axis Y Z Camera X
Transformation from WC to VC • Transformation sequences 1. Translate the view reference point to the origin of the WC system 2. Apply rotations to align the xv, yv, and zv axes with the world axes General sequence of translate-rotate transformation
Transformation from WC to VC (cont’) • Translation • view reference point(x0, y0, z0) • Rotation • rotate around the world xw axis to bring zv into the xwzw plane • rotate around the world yw axis to align the zw and zv axis • final rotation is about the zw axis to align the yw and yv axis
Transformation from WC to VC (cont’) • Rotation by uvn system • Calculate unit uvn vectors • N : view-plane normal vector • V : view-up vector • U : perpendicular to both N and V • Form the composite rotation matrix
Camera Models • The most common model is pin-hole camera • All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus) • Sensor response proportional to radiance • Other models consider… • Depth of field • Motion blur • Lens distortion
Viewing Parameters • Position • Eye position(px, py, pz) • Orientation • View direction(dx, dy, dz) • Up direction(ux, uy, uz) • Aperture • Field of view(xfov, yfov) • Film plane • “look at” point • View plane normal
Viewing Coordinate • Canonical coordinate system • Convention is right-handed (looking down – z axis) • Convention for projection, clipping, etc. Viewing up vector maps to Y axis Y Viewing back vector maps to Z axis (potting out of page) Viewing right vector maps to X axis X
Viewing Transformation • Transformation matrix maps camera basis vectors to canonical vectors in viewing coordinate system (0, 1, 0) Back Up Matrix (1, 0, 0) Eye Right (0, 0, 1)
Viewing Transformation P(x, y, z) 3D Object Coordinate Model Transformation 3D World Coordinate Viewing Transformation 3D Viewing Coordinate Projection Transformation Projection Transformation 2D Projection Coordinate Viewport Transformation 2D Device Coordinate p(x’, y’)
Projection • General definition • Transform points in n-space to m-space(m<n) • In computer graphics • Map viewing coordinates to 2D screen coordinates
Planar geometric projection Parallel Perspective Orthographic Oblique One-point Three-point Two-point Top Axonometric Cabinet Other Front Cavalier Side Taxonomy of Projections
Parallel & Perspective • Parallel Projection • Perspective Projection
Planar geometric projection Parallel Perspective Orthographic Oblique One-point Three-point Two-point Top Axonometric Cabinet Other Front Cavalier Side Taxonomy of Projections
Parallel Projection • Center of projection is at infinity • Direction of projection (DOP) same for all points DOP View Plane
Planar geometric projection Parallel Perspective Orthographic Oblique One-point Three-point Two-point Top Axonometric Cabinet Other Front Cavalier Side Taxonomy of Projections
Orthographic & Oblique • Orthographic parallel projection • the projection is perpendicular to the view plane • Oblique parallel projection • The projectors are inclined with respect to the view plane
Orthographic Projections • DOP perpendicular to view plane
Orthographic Projections • DOP perpendicular to view plane Front Side Top
Oblique Projections • DOP not perpendicular to view plane Cavalier (DOP at 45 ) Cabinet (DOP at 63.4 )
Oblique Projections • DOP not perpendicular to view plane • Cavalier projection • Cabinet projection
Parallel Projection Matrix • General parallel projection transformation WhereL1is the inverse of tan α , which is also the value ofLwhenz=1
Parallel Projection Matrix • General parallel projection transformation
Planar geometric projection Parallel Perspective Orthographic Oblique One-point Three-point Two-point Top Axonometric Cabinet Other Front Cavalier Side Taxonomy of Projections
Perspective Projection • Map points onto “view plane” along “projectors” emanating from “center of projection”(cop) Projectors Center of Projection View Plane
Perspective Projection • How many vanishing point?
Perspective Projection • How many vanishing point? Three-point perspective
Perspective Projection • How many vanishing point? Three-point perspective Two-point perspective
Perspective Projection • How many vanishing point? Three-point perspective Two-point perspective One-point perspective
Perspective Projection • Compute 2D coordinates from 3D coordinates with similar triangles
Perspective Projection • Compute 2D coordinates from 3D coordinates with similar triangles
Perspective Projection Matrix • 4x4 matrix representation?
Perspective Projection Matrix • 4x4 matrix representation?
Perspective Projection Matrix Perspective transformation Orthographic projection Perspective projection Center of Projection on the y axis Center of Projection on the x axis
Perspective Projection Matrix 2-point perspectives 3-point perspectives