680 likes | 722 Views
Explore the complexity of 3D viewing operations and coordinate systems in computer graphics. Understand transformation from world to viewing coordinates and projection transformations.
E N D
Computer Graphics Chapter 10 Three-Dimensional Viewing
1. Overview of 3D Viewing • 2D Viewing operation • to position from world-coor. plane to device-coor. plane World (2D) Window in the world Display device (2D) Viewportin the display device • 3D Viewing operation : much more complicated!!! https://www.youtube.com/watch?v=nJh9qpyo6EY Computer Vision & Pattern Recognition Lab.
1. Overview of 3D Viewing Computer Vision & Pattern Recognition Lab.
1. Overview of 3D Viewing • 3D Viewing operation : much more complicated than 2D viewing • projection from 3D scene to a planer surface • more choice as to how we construct a scene • visible parts of a scene must be identified • lighting effects and surface characteristics must be taken into account Computer Vision & Pattern Recognition Lab.
2. 3D Viewing Pipeline • A view of a 3D scene • analogous to the processes in taking a photograph • to take a picture • camera position • camera orientation • viewing window(zooming) Computer Vision & Pattern Recognition Lab.
2. 3D Viewing Pipeline https://www.youtube.com/watch?v=cvcAjgMUPUA • A view of a 3D scene https://youtu.be/7SXzTIWmPnw Computer Vision & Pattern Recognition Lab.
Modeling Coordinate(MC) • Modeling • To define 3D objects • Set of meshes • Set of vertices • Modeling Coordinate System(MCS) or Local Coordinate System(LCS) • Each object has its own coordinate • Origin and axis orientation: arbitrary
World Coordinate(WC) • 3D World • Objects are described in their own coordinates => Coordinate systems are different from each other => One reference coordinate system is needed => World Coordinate System • World Coordinate System(WCS) • Origin and axis orientation: arbitraryin 3D world
Viewing Coordinate(VC) • Viewing coordinate (VC) • Objects look different depending on viewer’s location • To display objects seen from the viewer, objects in WC should be transformed into viewer’s coordinate => Viewing Coordinate System(VCS) • VC can be defined by (1) Viewer’s location (2) Look-at point
Viewing Coordinate(VC) • Origin of VCS= Camera location • z axis of VCS : from look-at point to camera position • Projection Plane(or View Plane): perpendicular to z axis • View Window (in projection plane): Camera film • yaxisof VCS = y axis of view window • x axis of VCS = x axis of view window
3. 3D Viewing Coordinates • To specify view reference coordinate (1) View Reference Point (VRP) (2) View Plane Normal (VPN) (3) View Up Vector (VUP) (1) View reference point (VRP) • the origin of viewing-coordinate system • the position where we want to locate a camera to take a picture Computer Vision & Pattern Recognition Lab.
3. 3D Viewing Coordinates (2) View plane normal(VPN), N • zv axis of View Reference Coordinate • perpendicular to the projection plane • from the look-at point (Pref) to the view reference point (P0) (viewing direction is opposite to N) • specified as a world coordinate vector P0 : view reference point Pref : look-at point Computer Vision & Pattern Recognition Lab.
3. 3D Viewing Coordinates (3) View-up vector(VUP), V • used to establish the positive direction for the yv axis • defined as a world-coordinate vector • simply choose V as the world vector (0, 1, 0), and this vector will be projected into the plane perpendicular to N (using vector products) Computer Vision & Pattern Recognition Lab.
Inner Product, Dot Product • Outer Product, Cross Product
3. 3D Viewing Coordinates • viewing-coordinate (uvn axes) • VPN defines z axis : n • VUP defines xaxis : u • nandudefine yaxis : v Computer Vision & Pattern Recognition Lab.
4. Transformation from WC to VC • To define viewing coordinate (Summary) (1) View Reference Point (VRP) (2) View Plane Normal (VPN) or Look-at point * View Up Vector (VUP) is a constant vector (0,1,0)
4. Transformation from WC to VC • To define transformation matrix from WC to VC • Translate the view reference point to the origin of WC • Apply rotations to align the xv, yv, and zv axes with the xw, yw, and zw axes, respectively Computer Vision & Pattern Recognition Lab.
4. Transformation from WC to VC • Translation matrix • View reference point (x0, y0, z0) • Rotation matrix • Complete world-to-viewing coordinate transformation Computer Vision & Pattern Recognition Lab.
4. Transformation from WC to VC • Example • Unit cube located at the origin • VRP = (2,2,2) P • Look-at point P = (1,1,1) Solution VRP = (2,2,2) Computer Vision & Pattern Recognition Lab.
4. Transformation from WC to VC • Compute the coordinate of P(1,1,1), transformed from WC to VC? Computer Vision & Pattern Recognition Lab.
5. Projection Transformations • 3D objects mapped onto 2D plane
5. Projection Transformations • Two basic projection models • Parallel projection: coordinate positions are transformed to the view plane along parallel lines • Orthographic(Orthogonal) parallel projection • Oblique parallel projection • Perspective projection: object positions are transformed to the view plane along lines that converge to a point called the projection reference point (or center of projection) Computer Vision & Pattern Recognition Lab.
5. Projection Transformations • Human visual system is similar to perspective projection Computer Vision & Pattern Recognition Lab.
5. Projection Transformations • Parallel Projections • According to the direction for the projection lines • Orthographic parallel projection • projection is perpendicular to the view plane • Oblique parallel projection • projection is not perpendicular to the view plane Computer Vision & Pattern Recognition Lab.
6. Orthographic Parallel Projections • Orthographic projections • Elevation View • front, side and rear orthographic projections • Plan View • top orthographic projection Computer Vision & Pattern Recognition Lab.
6. Orthographic Parallel Projections • Transformation equation • With projection direction parallel to zv axis, Computer Vision & Pattern Recognition Lab.
6. Orthographic Parallel Projections • Clipping window and orthogonal-projection view volume • Clipping window: define the part of the scene that we want to display Orthogonal-projection view volume (infinite region) near-far(front-back) clipping planes Finite view volume (rectangular parallelepiped) Computer Vision & Pattern Recognition Lab.
6. Orthographic Parallel Projections Computer Vision & Pattern Recognition Lab.
6. Orthographic Parallel Projections • Normalization transformation for clipping (skip!) • Rectangular-parallelepiped view volume to normalized view volume • (-1, -1, -1) • (1, 1, 1) Computer Vision & Pattern Recognition Lab.
6. Orthographic Parallel Projections • After normalization transformation, clipping procedures can be efficiently performed. Computer Vision & Pattern Recognition Lab.
6. Orthographic Parallel Projections Computer Vision & Pattern Recognition Lab.
7. Oblique Parallel Projections • Oblique projection • Projection path is not perpendicular to the view plane Computer Vision & Pattern Recognition Lab.
7. Oblique Parallel Projections Cavalier projections Cabinet projections Computer Vision & Pattern Recognition Lab.
7. Oblique Parallel Projections • Oblique parallel-projection view volume (skip!) Computer Vision & Pattern Recognition Lab.
8. Perspective Projections • Perspective Projection • Projection Reference Point (PRP) (VC에서 정의) or Center of Projection (COP) Computer Vision & Pattern Recognition Lab.
8. Perspective Projections • Perspective Projection • Distant objects look smaller!!! Computer Vision & Pattern Recognition Lab.
8. Perspective Projections (skip!) • Perspective-Projection Transformation (VC to PC) • Problem: Given (xprp,yprp,zprp), zvp and (x,y,z), find (xp,xp) • Solution: To use parametric representation • Projection line passing through 2 points in parametric form • (x’, y’, z’): any point along the projection line Computer Vision & Pattern Recognition Lab.
8. Perspective Projections (skip!) • Parametric representation of a line passing through 2 points • Linear blending(weighting) of 2 points (1-t), (t) Line: P2 1 - t t =1 t P1 r(t) t = 0 Curve modeling
8. Perspective Projections (skip!) P = (x, y, z) (xp, yp, zp) PRP = (xprp, yprp, zprp) zvp zprp Eq.(10-17) z’=zvp Computer Vision & Pattern Recognition Lab.
8. Perspective Projections (skip!) • Special cases Eq.(10-18) Eq.(10-20) Eq.(10-19) Eq.(10-21) Computer Vision & Pattern Recognition Lab.
8. Perspective Projections (skip!) • Perspective Projection Transformation matrix • Transformation from (x, y, z) to (xp, yp, zvp) • From eq (10-18) Computer Vision & Pattern Recognition Lab.
8. Perspective Projections zvp Computer Vision & Pattern Recognition Lab.
8. Perspective Projections • Perspective Projection Transformation matrix • If • If Computer Vision & Pattern Recognition Lab.
8. Perspective Projections • Perspective effects depend on the distance between the projection reference point and the view plane Computer Vision & Pattern Recognition Lab.
8. Perspective Projections • Vanishing points • The point at which a set of projected parallel lines converge • Principal vanishing point • The vanishing point for any set of lines that are parallel to one of the principal axes of an object • The number of principal axes intersecting the view plane determines the number of vanishing points Computer Vision & Pattern Recognition Lab.
8. Perspective Projections One point perspective: One principal axis intersects view plane Computer Vision & Pattern Recognition Lab.
8. Perspective Projections Two point perspective: two principal axes intersect view plane Computer Vision & Pattern Recognition Lab.
8. Perspective Projections Three point perspective: Three principal axes intersect view plane Computer Vision & Pattern Recognition Lab.
8. Perspective Projections • Perspective-projection view volume (Pyramid of vision) + near-far clipping planes Truncated pyramid (Frustum) view volume https://www.youtube.com/watch?v=BrfRSx7ObL0 Computer Vision & Pattern Recognition Lab.