Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of North Carolina at Greensboro

Similar presentations


Presentation on theme: "University of North Carolina at Greensboro"— Presentation transcript:

1 University of North Carolina at Greensboro
Computer Graphics using OpenGL, 3rd Edition F. S. Hill, Jr. and S. Kelley Chapter 7. 6 Three-dimensional Viewing S. M. Lea University of North Carolina at Greensboro © 2007, Prentice Hall

2 Classifying Planar Projections

3 Types of Perspective Projection
Principal Planes and Principal Axes:

4 Types of Perspective Projection (2)
One-point Projection: exactly one axis has a vanishing point. The n axis is perpendicular to a principal plane, and the camera is level.

5 Types of Perspective Projection (3)
Two-point Projection: exactly 2 axes have a vanishing point. The n axis is perpendicular to a principal axis, usually the y-axis (up); n and u are in the x-z plane. Typically used for drawings of buildings. The camera is level and is looking at an edge.

6 Types of Perspective Projection (≤)

7 Types of Perspective Projection (5)
Two-point projection of a plane grid:

8 Types of Perspective Projection (6)
Three-point Projection: all 3 axes have a vanishing point. None of the components of n is 0. The camera is looking up or down at the corner of an object. An example would be standing looking at the corner of a rectangular skyscraper.

9 Types of Perspective Projection (7)

10 Perspective Projection (7)

11 Types of Parallel Projections
Parallel Projections: all points are projected along lines parallel to a vector d.

12 Orthographic and Oblique Parallel Projections
Oblique: n is not parallel to d (left). Orthographic: n is parallel to d (right).

13 Orthographic Projection
Receding lines are foreshortened; the projection preserves the exact shape of one face of the object.

14 OpenGL Orthographic Projection
OpenGL uses the projection matrix to describe the view volume of the camera. Specifically, the projection matrix specifies how to transform vertices to squash them into the canonical view volume (CVV). Suppose the actual view volume extends from l to r (short for left and right) in x, from b to t (short for bottom and top) in y, and from n to f (short for near and far) in z.

15 OpenGL Orthographic Projection (2)
To transform this parallelepiped into the CVV we must translate and scale so that the CVV extends from -1 to 1 in each dimension. The matrix at right maps the view volume into the CVV. This is the one formed by a call to glOrtho().

16 OpenGL Orthographic Projection (3)
If you multiply it by P (expressed in homogeneous coordinates), you get the actual point p OpenGL submits for clipping and mapping to the viewport. OpenGL does not set the z-component to 0 as in our formulation above. It performs a transformation, not a projection. It ultimately does the actual projection by separating off the z-component at the very end, using the x- and y- components in screen coordinates for drawing, and the z-component for depth testing.

17 Orthographic Projection: Axonometric

18 Orthographic Projection: Isometric
All 3 principal axes foreshortened equally.

19 Orthographic Projection: Dimetric
2 principal axes foreshortened equally.

20 Orthographic Projection: Trimetric
Each of the 3 principal axes is foreshortened unequally.

21 Oblique Projection Image is sheared to make additional sides visible. Preserves exact shape of one face. (Not supported by OpenGL.)

22 Oblique Projection Different projections depending on direction of d.

23 Oblique Projection Matrix
Cavalier: dx = dy = dz Cabinet: dx = dy = dz/2 others: dx = dy = 3 dz/4, dx = dy = 2 dz/3


Download ppt "University of North Carolina at Greensboro"

Similar presentations


Ads by Google