Viewing in 3D Chapter 6.

Slides:



Advertisements
Similar presentations
Computer Graphics Lecture 8 Arbitrary Viewing II: More Projection, Clipping and Mathematics of 3D Viewing.
Advertisements

Three Dimensional Viewing
1 Computer Graphics Chapter 8 3D Transformations.
Projection.
CS 325 Introduction to Computer Graphics 02 / 24 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 26 / 2007 Instructor: Michael Eckmann.
3D Concepts UNIT 3. 3-D Coordinate Spaces Remember what we mean by a 3-D coordinate space x axis y axis z axis P y z x Right-Hand Reference System.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Visualization- Determining Depth From Stereo Saurav Basu BITS Pilani 2002.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
Computer Graphics (fall 2009)
Transformation & Projection Feng Yu Proseminar Computer Graphics :
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
CS 376 Introduction to Computer Graphics 02 / 23 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
Basic Projections 2D to 3D
CS 325 Introduction to Computer Graphics 02 / 26 / 2010 Instructor: Michael Eckmann.
2003CS Hons RW778 Graphics1 Chapter 7: Three-Dimensional Viewing Chapter 5: Camera with parallel projection Chapter 5: Camera with parallel projection.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Three-Dimensional Viewing
Three-Dimensional Viewing Hearn & Baker Chapter 7
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Viewing and Projection
CS 376 Introduction to Computer Graphics 02 / 21 / 2007 Instructor: Michael Eckmann.
RAC/RA Projection Types of Projection Simple Projections Generalized Projection.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Computer Graphics Lecture 19 PROJECTIONS I Taqdees A. Siddiqi
Projection. Conceptual model of 3D viewing process.
Computer Graphics Projections.
Viewing in 3D Lecture 11. Viewing in 3D2 u The 3D viewing process is inherently more complex than is the 2D viewing process. F In 2D, we simply specify.
3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU.
CS552: Computer Graphics Lecture 9: Perspective Projection.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Three Dimensional Viewing
Rendering Pipeline Fall, 2015.
Computer Graphics CC416 Week 14 3D Graphics.
University of North Carolina at Greensboro
Transformations contd.
PERSPECTIVE PROJECTION…...
Projection Our 3-D scenes are all specified in 3-D world coordinates
3D Viewing cgvr.korea.ac.kr.
Prof. Lizhuang Ma Shanghai Jiao Tong University
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
Computer Graphics Viewing
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 20 Parallel Projections in OpenGL
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Unit 4 3D Viewing Pipeline Part - 2
CENG 477 Introduction to Computer Graphics
3D Clipping.
Projections and Normalization
CSC461: Lecture 19 Computer Viewing
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
Clip against view volume Project onto projection plane
Chapter V Vertex Processing
Last Time Canonical view pipeline Projection Local Coordinate Space
3D Graphics.
Viewing (Projections)
Viewing (Projections)
Prof. Lizhuang Ma Shanghai Jiao Tong University
THREE-DIMENSIONAL VIEWING II
THREE-DIMENSIONAL VIEWING
Viewing Transformations II
Presentation transcript:

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. 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

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

Creation of our photo is accomplished as a series of steps: 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

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

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

Chapter 6 -- Viewing in 3D

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

And Chapter 6 -- Viewing in 3D

4.2 Parallel Projections Chapter 6 -- Viewing in 3D

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

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

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

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

We use similar triangles as found in this figure 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

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

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

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

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

Then the rest of the process is done 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Object Coordinate System This is the system farthest removed from the actual display device. The term local coordinate system is also commonly used here World Coordinate System Objects are transformed into this system by a modeling transformation. This system is sometimes called the application-coordinate system Chapter 6 -- Viewing in 3D

The View-Reference coordinate system used by some systems to define a view volume. sometimes called the eye-coordinate system or the camera-coordinate system. Normalized-Projection coordinate system or 3D screen coordinates. it is called normalized because the values are in the interval [0,1] (or [-1,1]) Chapter 6 -- Viewing in 3D

The 2D Device coordinate system projections from 3D into 2D creates this. also called many other things: screen coordinate system,... Unfortunately there is no single standard usage for many of these terms. for example, the term screen-coordinate system is used by different authors to refer to the last three systems discussed. Chapter 6 -- Viewing in 3D