1 / 53

Viewing in 3D

Viewing in 3D. Chapter 6. The 3D viewing process is inherently more complex than is the 2D viewing process. In 2D, we simply specify a window on the 2D world and a viewport on the 2D view surface.

dirkc
Download Presentation

Viewing in 3D

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. Viewing in 3D Chapter 6

  2. The 3D viewing process is inherently more complex than is the 2D viewing process. • In 2D, we simply specify a window on the 2D world and a viewport on the 2D view surface. • Conceptually, objects in the world are clipped against the window and then transformed into the viewport for display. • Although 3D viewing may seem overwhelming at first, it is less daunting when viewed as a series of easily understood steps, many of which we have prepared for in earlier chapters. Chapter 6 -- Viewing in 3D

  3. 1. The Synthetic Camera and Steps in 3D Viewing • A useful metaphor for creating 3D scenes is the notion of a synthetic camera Chapter 6 -- Viewing in 3D

  4. While the synthetic camera is a useful concept, there is a bit more to producing an image than just pushing a button. • Creation of our photo is accomplished as a series of steps: • Specification of projection type • Specification of viewing parameters • Clipping in three dimensions • Projection and Display Chapter 6 -- Viewing in 3D

  5. 2. Projections • In general, projections transform points in a coordinate system of dimension n into points in a coordinate system of dimension less than n. • For now we shall limit ourselves to 3D to 2D. Chapter 6 -- Viewing in 3D

  6. The projection of a 3D object is defined by straight projection rays, called projectors, emanating from a center of projection, passing through each point of the object, and intersecting a projection plane to form the projection. • Two locations for the center of projection: • finite distance (perspective projection) and • infinite distance (parallel projection) Chapter 6 -- Viewing in 3D

  7. Chapter 6 -- Viewing in 3D

  8. 2.1 Perspective Projections • The perspective projections of any set of parallel lines that are not parallel to the projection plane converge to a vanishing point. • if the set of lines is parallel to one of the three principal axes, the vanishing point is called an axes vanishing point Chapter 6 -- Viewing in 3D

  9. Perspective projections are categorized by their number of principal vanishing points • One point perspective projection Chapter 6 -- Viewing in 3D

  10. Two point perspective projection Chapter 6 -- Viewing in 3D

  11. 2.2 Parallel Projections • Parallel projections are categorized into two types, depending on the relation between the direction of projection and the normal to the projection plane. • The two most common are: • orthographic -- direction of the projection and the normal of the plane are the same • oblique -- they are not the same. Chapter 6 -- Viewing in 3D

  12. The most common types of orthographic projections are • front-elevation • top-elevation • side-elevation Chapter 6 -- Viewing in 3D

  13. A special sub-type of orthographic projections are isometric projections. The projection plan normal makes equal angles with each principal axis. Chapter 6 -- Viewing in 3D

  14. The other type of parallel projection is an Oblique projection • the projection plane normal and the direction of the projection differ. Chapter 6 -- Viewing in 3D

  15. 3. Specification of an Arbitrary 3D View • 3D viewing involves not just a projection, but also a view volume against which the 3D world is clipped. • The projection and the view volume together provide all the information that we need to clip and project into 2D space. • Then the 2D transformation into physical device coordinates is straightforward. Chapter 6 -- Viewing in 3D

  16. The projection plane (view plane in the graphics literature) is defined by • a point in the plane called a view reference point (VRP) and • a normal to the plane called the view-plane normal (VPN) Chapter 6 -- Viewing in 3D

  17. To define a window on the view plane, we need to specify minimum and maximum window coordinates Chapter 6 -- Viewing in 3D

  18. for a perspective projection it looks like: for a parallel projection it looks like: • The center of projection and direction of projection are defined by the Projection Reference Point (PRP) Chapter 6 -- Viewing in 3D

  19. At times we may want the view volume to be finite, in order to limit the number of output primitives projected onto the view plane. • You specify the front and back clipping planes • For parallel projections it looks like: • for perspective projections it looks like: Chapter 6 -- Viewing in 3D

  20. 4. Examples of 3D Viewing • In this section, we consider how we can apply the basic viewing concepts introduced in Section 3 to create a variety of projections. • such as this house. Chapter 6 -- Viewing in 3D

  21. Because this house is used throughout this section, it will be helpful to remember its dimensions and position, which are indicated here: Chapter 6 -- Viewing in 3D

  22. 4.1 Perspective Projections • To obtain the front one-point perspective view shown here: • position the center of projection (the viewer) at (8,6,84) Chapter 6 -- Viewing in 3D

  23. To make the vie larger and centered, • make the view plane and the front of the house coincide. • place the viewer at (8, 6, 30) in front of this plane. Chapter 6 -- Viewing in 3D

  24. Other views could look like: Chapter 6 -- Viewing in 3D

  25. And Chapter 6 -- Viewing in 3D

  26. 4.2 Parallel Projections Chapter 6 -- Viewing in 3D

  27. 4.3 Finite View Volumes • In all the examples so far, the view volume has been assumed to be infinite. • If we start with this setup Chapter 6 -- Viewing in 3D

  28. and add a far clipping plane right in front of the far wall of the house, we can end up with an image that looks like: Chapter 6 -- Viewing in 3D

  29. 5. The Mathematics of Planar Geometric Projections • Here we introduce the basic mathematics of planar geometric projections. • For simplicity, we start by assuming that, • in the perspective projection, the projection plane is normal to the z axis at z=d, • and that in the parallel projection, the projection plane is at z=0. Chapter 6 -- Viewing in 3D

  30. Each of the projections can be defined by a 4x4 matrix. • This is convenient, because the projection matrix can be composed with the transformation matrices, allowing two operations (transform then project) to be represented in a single matrix. • In this section we derive 4x4 matrices for several projections Chapter 6 -- Viewing in 3D

  31. Given a point P to be projected onto the plane, calculate the point Pp=(xp, yp, zp) which is the projection. We use similar triangles as found in this figure and calculate ratios for the transformation as: Chapter 6 -- Viewing in 3D

  32. These ratios lead to a transformation matrix for a perspective projection of: Chapter 6 -- Viewing in 3D

  33. The orthographic projection pane at z=0 is straightforward, and ends up as: Chapter 6 -- Viewing in 3D

  34. 6. Implementation of Planar Geometric Projections • Given a view volume and a projection, let us consider how the viewing operation of clipping and projecting is applied. • The brute force method was: • clip each line with the 6 planes of the volume. • project remaining lines by solving simultaneous equations for the projection onto the view plane • Then transform these to 2D space... Chapter 6 -- Viewing in 3D

  35. The large number of calculations required for this process, repeated for many lines, involves considerable computing. • Happily there is a more efficient procedure, based on the divide-and-conquer strategy of breaking down a difficult problem into a series of simpler ones. • And they are much easier if you use the canonical volumes shown here: Chapter 6 -- Viewing in 3D

  36. Our goal is to find the normalizing transformations Npar and Nper that transform an arbitrary parallel or perspective projection view volume into the parallel and perspective view volumes • Then the rest of the process is done • clipping, • projection into 2D Chapter 6 -- Viewing in 3D

  37. 6.1 The Parallel Projection Case • In this section, we derive the normalizing transformation Npar for parallel projections. • This is done in order to transform world-coordinate positions such that the view volume is transformed into the canonical view volume. • Then we clip and project. Chapter 6 -- Viewing in 3D

  38. Transformation Npar is derived for the most general case, the oblique (rather than the orthographic) parallel projection. • Npar thus includes a shear transformation that causes the direction of projection in viewing coordinates to be parallel to z. • By including this shear we can do the projection onto z=0 plane simply by setting z=0. Chapter 6 -- Viewing in 3D

  39. The series of transformations that make up Npar is as follows: • Translate the VRP to the origin • Rotate VRC such that the n axis (VPN) becomes the z axis, the u axis becomes the x axis, and the v axis becomes the y axis. • Shear such that the direction of projection becomes parallel to the z axis. • Translate and scale into the parallel-projection canonical view volume. Chapter 6 -- Viewing in 3D

  40. 6.2 The Perspective Projection Case • We now develop the normalizing transformation Nper for perspective projections. • Nper transforms world-coordinate positions such that the view volume becomes the perspective-projection canonical view volume, the truncated pyramid with the apex at the origin. • Then you clip and project using Mper derived in section 6.5. Chapter 6 -- Viewing in 3D

  41. The series of transformations making up Nper as follows: • Translate VRP to the origin • Rotate VRC such that the n axis (VPN) becomes the z axis, the u axis becomes the x axis, and the v axis becomes the y axis. • Translate such that the center of projection (COP), given by the PRP, is at the origin. • Shear that the center line of the view volume becomes the z axis • Scale such that the view volume becomes the canonical perspective view volume, the truncated right pyramid. Chapter 6 -- Viewing in 3D

  42. This figure presents the view volume before and after the steps just described. Chapter 6 -- Viewing in 3D

  43. 6.3 Clipping Against a Canonical View Volume in 3D • The canonical view volumes are: • the 2x2x1 prism for parallel projections • the truncated right regular pyramid for perspective projections Chapter 6 -- Viewing in 3D

  44. Both the Cohen-Sutherland and Cyrus-Beck clipping algorithms discussed in Chapter 3 readily extend to 3D • There are also other clipping algorithms that are based on parametric expressions that can be more efficient than the simple Cohen-Sutherland algorithm (see Chapters 6 and 19 of Foley, vanDam, et.al. --the big white book). Chapter 6 -- Viewing in 3D

  45. 6.4 Clipping in Homogeneous Coordinates • There are two reasons to clip in homogeneous coordinates: • efficiency • translate perspective canonical to parallel canonical and do a single clip -- Hardware does this. • if you get a point with negative W it can be clipped in homogeneous, but not in 3D • get negative W’s from unusual homogeneous transformations and from the use of parametric splines. Chapter 6 -- Viewing in 3D

  46. With regard to clipping, it can be shown that the transformation from the perspective-projection canonical view volume to the parallel-projection canonical view volume is: Chapter 6 -- Viewing in 3D

  47. This matrix translates the canonical view volumes as shown: • As we will see in Chapter 9, it is sometimes desirable to represent points directly in homogeneous coordinates with arbitrary W. Chapter 6 -- Viewing in 3D

  48. 6.5 Mapping into a Viewport • Output primitives are clipped in the normalized projection coordinate system, which is also called the 3D screen coordinate system Chapter 6 -- Viewing in 3D

  49. 6.6 Implementation Summary • There are two generally used implementations of the overall viewing transformation • The first was discussed in Sections 6.6.1 through 6.6.3 • appropriate when primitives are defined in 3D and the transformations never create a negative W. • The second was discussed in Section 6.6.4 • required whenever primitives are defined and might have W<0, when transformations might create a W<0, or a single clip algorithm is implemented. Chapter 6 -- Viewing in 3D

  50. 7. Coordinate Systems • Several different coordinate systems have been used in Chapters 5 and 6. • In this section we summarize all the systems, and also discuss their relationships to one another. Chapter 6 -- Viewing in 3D

More Related