1 / 9

Chapter 4: Viewing

Chapter 4: Viewing. Projections Parallel Projections Perspective Projections Hidden Surface Removal Z-Buffering Backface Culling. Projections Converting 3D to 2D. When 3-D objects are rendered in a 2-D environment, some form of projection is used to eliminate the “extra” dimension.

neil
Download Presentation

Chapter 4: Viewing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 4: Viewing • Projections • Parallel Projections • Perspective Projections • Hidden Surface Removal • Z-Buffering • Backface Culling Chapter 4: Viewing

  2. Projections Converting 3D to 2D When 3-D objects are rendered in a 2-D environment, some form of projection is used to eliminate the “extra” dimension. The two primary types of projections are: • Parallel, in which one dimension is merely deleted • Perspective, in which a formal mapping is performed to provide some degree of foreshortening to the rendered image. While parallel projections are computationally inexpensive and provide a good notion of actual distances (at least with respect to the remaining dimensions), perspective projections provide better realism. With either type of projection, we require a 4x4 matrix that will map 3-D points (in homogeneous coordinates) to 2-D points on the viewscreen. Chapter 4: Viewing

  3. Projections Orthographic (Parallel) Projections Useful for drafting and design specifications, parallel projections do not tend to provide realistic views of 3-D objects. Orthographic Projection Matrix (to x-y plane) Chapter 4: Viewing

  4. Projections Perspective Projections To make distant objects appear smaller, perspective projections are used. Now there are vanishing points in the distant left and right, as well as below the floor. One vanishing point, straight ahead of the viewer. A second vanishing point is added, below the floor. Perspective Projection Matrix for one vanishing point on the z-axis, with a center of projection at (xc, yc, zc) (Additional vanishing points may be produced by then applying rotations around the appropriate axes.) Chapter 4: Viewing

  5. Projections Vanishing Points Where are the vanishing points in this scene from “BioShock Infinite”? Chapter 4: Viewing

  6. Projections View Frustum The actual “view volume” of a scene is limited by near and far clipping planes, as well as limitations on the horizontal and vertical viewing angles. The textbook shows that the perspective projection matrix at right would handle the frustum bounded by left and right in the x dimension, bottom and top in the y dimension, and near and far in the z dimension. Chapter 4: Viewing

  7. Hidden Surface Removal Z-Buffering When rendering a polyhedral object, the order in which the faces are rendered could damage the final image. Z-buffering is a simple (i.e., easy to program, but very inefficient) method for addressing this problem. Drawing left, front, top, right, back, and bottom, in that order Drawing bottom, back, right, left, front, and top, in that order This algorithm maintains a depth buffer that stores the z-coordinate of every pixel in the image space. For each polygon in the image, its affected pixels are determined and the depth buffer value corresponding to each pixel is updated if the z-coordinate for the object is closer to the viewer than the current buffer value. Chapter 4: Viewing

  8. Hidden Surface Removal Backface Culling By determining each polygon’s normal vector (the one pointing out of the polyhedron) and the vector from the surface to the viewer, it can easily be determined (via the dot product) whether the polygon is facing the viewer or facing away from the viewer. Backface Culling Only Backface Culling , Followed By Z-Buffer No Hidden Surface Removal If the polygonal face is pointed away from the viewer, then the polygon need not be rendered at all. (Note: This is only guaranteed to work if the polyhedron is convex!) Chapter 4: Viewing

  9. Projection Shadows Simple Planar Projections When casting shadows from a directional light source onto planar surfaces, a simplistic implementation combines translations and perspective projections. And finally, translate back by the light’s position Second, project to the shadow plane (in this case, the x-z plane) First, translate by the negative of the light’s position For every vertex on the 3d object being “shadowed” Chapter 4: Viewing

More Related