0% found this document useful (0 votes)
48 views56 pages

Lecture 6 (3D Viewing)

The document discusses 3D viewing and projection techniques used in computer graphics. It covers: 1) The 3D viewing pipeline which includes modeling, viewing, projection, and workstation transformations to map 3D world coordinates to 2D screen coordinates. 2) Types of projections - perspective projections mimic a camera and parallel projections preserve measurements. 3) Steps in 3D viewing involve specifying the projection type, viewing parameters, 3D clipping, and projecting onto the image plane.

Uploaded by

Kylle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views56 pages

Lecture 6 (3D Viewing)

The document discusses 3D viewing and projection techniques used in computer graphics. It covers: 1) The 3D viewing pipeline which includes modeling, viewing, projection, and workstation transformations to map 3D world coordinates to 2D screen coordinates. 2) Types of projections - perspective projections mimic a camera and parallel projections preserve measurements. 3) Steps in 3D viewing involve specifying the projection type, viewing parameters, 3D clipping, and projecting onto the image plane.

Uploaded by

Kylle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 56

Viewing in 3D

CMSC 161 – Interactive Computer Graphics


2D Viewing Pipeline

• A world-coordinate area selected for display is called a


window
• An area on a display device to which a window is mapped
is called a viewport
• The window defines what is to be viewed; the viewport
defines where it is to be displayed
2D Viewing Pipeline

• In general, the mapping of a part of a world-coordinate


scene to device coordinates is referred to as a viewing
transformation
• Sometimes the 2D viewing transformation is referred to as
the window-to-viewport transformation or windowing
transformation
Viewing in 3D

• For 3D graphic applications, the situation is a bit more


involved
– More choices as to how views are to be generated
• Steps are analogous to the processes involved in taking a
photograph
Synthetic Camera

• A useful metaphor for creating 3D scenes is the notion of a


synthetic camera
• We imagine that we move our camera to any location,
orient it in any way we wish, and with a snap of the shutter,
create a 2D image of a 3D object
• The camera can become a motion-picture camera
Steps in 3D Viewing

• Creation of our “photo” is actually accomplished as a series


of steps:
– Specification of projection type
– Specification of viewing parameters
– Clipping in three dimension
– Projection and display
3D Viewing Pipeline

• Any point in the scene can be expressed with respect to several


coordinate systems:
– Object Coordinate System (OCS)
• Coordinate system by which each object is defined
– World Coordinate System (WCS)
• Coordinate system used to define the scene
• All objects are placed with respect to WCS
– Viewing Coordinate System
• Coordinate system whose origin is the eye position
• Also called the uvn coordinate system
– Device Coordinate System
• Coordinate system of the display device (monitor)
Illustration

yworld yview
xview

zview
xworld

zworld yview
xview

zview
3D Viewing Pipeline

• Includes the steps


for computer
generation of a view
of a 3D object
3D Viewing Pipeline
• Modeling transformation
– Transformation performed in order to properly position the objects in the scene
– Done using a sequence of translation, scaling and rotation transformations
• Viewing transformation
– Computes the coordinates of the objects with respect to the VCS
• Projection transformation
– Projects the object onto the image plane by computing the points of intersection between
the plane and the projectors
• Workstation transformation
– Computes the screen coordinates of the projected points
Planar Geometric Projections

• The class of projections with which we deal with is known


as planar geometric projections, because the projection is
onto a plane rather than onto a curved surface, and uses
straight rather than curved projectors
• Cartographic projections are either non-planar or non-
geometric
Projections
Projections

• Two basic classes, distinction lies in the relation of the


center of projection to the projection plane:
– Perspective – distance from one to the other is finite; when
defining perspective projections, we explicitly specify its center of
projection
– Parallel – distance is infinite; for a parallel projection, we give its
direction of projection
Projections

• The projection of a 3D object is defined by straight projection rays,


called projectors, emanating from a center (or direction) of
projection, passing through each point of the object, and intersecting
a projection plane to form the projection
Perspective Projection

• The visual effect of a perspective projection is similar to that of


photographic systems and of the human visual system.
• This is known as perspective foreshortening: the size of the
perspective projection of an object varies inversely with the distance
of that object from the center of projection

Projection plane

Center of projection
Perspective Projection
• Tends to look realistic
• Not useful for recording the exact
shape and measurements of the
objects
• Distance cannot be taken from the
projection
• Angles preserved only on those faces
of the object parallel to the projection
plane
• Parallel lines do not in general project
as parallel lines
Perspective Projection

• The perspective projections of any set of parallel lines that


are not parallel to the projection plane converge to a
vanishing point
Vanishing Line

Vanishing Point
Projection Center
COP

View Plane
Perspective Projection

• Categorized by the number of principal


vanishing points (and therefore the number
of principal axes the projection plane cuts)
– One-point
– Two-point – commonly used in architectural,
engineering, industrial design, and in advertising
drawings
– Three-point – used less frequently, since they
add little realism beyond that afforded by the
two-point perspective
One-point Perspective Projection
Two-point Perspective Projection
Three-point Perspective Projection
Perspective Projection

View Plane
Three point

Two point

One point
Parallel Projection

• Less realistic view because


perspective foreshortening
is lacking
• Can be used for exact
measurements
• Parallel lines do remain
parallel
Parallel Projection

• Categorized depending on the relation between the


direction of projection and the normal to the projection
plane
– In orthographic parallel projections, these directions are the
same (or the reverse of each other), so the direction of
projection is normal to the projection plane
– For oblique projections, the projection-plane
normal and the direction of projection differ
Orthographic Parallel Projection

• The most common types are:


– Front – elevation
– Top – elevation (also called plan – elevation)
– Side – elevation
• In all these, the projection plane is perpendicular to a
principal axis, which is therefore the direction of
projection
Front, Top and Side Elevations
Isometric Projection

• The projection-plane normal makes equal angles with


each principal axis
• All three principal axes are equally foreshortened,
allowing measurements along the axes to be made to
the same scale
Isometric Projection

• Principal axes project so as to make equal angles


(120º) with one another

x 120 120

120

Projection Plane

z
Isometric Projection

• Results in a perceived distortion


• Could easily result in situations where depth and altitude
are impossible to gauge
Projections

• The common thread uniting them all is that they involve


– a projection plane
– a direction to the center of projection
– a distance to the center of projection
View Volume

• Only those objects within the view volume will appear in


the generated display on an output device; all others are
clipped from the display
• Size depends on the size of the window, while the shape
depends on the type of projection used to generate the
display
– What is the shape for a parallel projection?
– A pespective projection?
View Volume
3D Viewing Transformations

CMSC 161 – Interactive Computer Graphics


Overview

• Viewing Transformation
• Projection Transformation
– Parallel Projection
• Orthographic Projection
• Oblique Projection
• Isometric Projection
– Perspective Projection (One-point)
Viewing Transformation

• Computes the viewing coordinates given the world


coordinates of a point
• Given the eye position (ex,ey,ez) and the vectors u =
(ux,uy,uz), v = (vx,vy,vz) and n = (nx,ny,nz), the viewing
coordinates of a point P = (Px,Py,Pz) can be computed as
Viewing Transformation

• Find the viewing coordinates of the point (4, 1, 3) given:


– eye position = (0, 0, 12)
– n-vector = (0, 0, 1)
– v-vector = (0, 1, 0)
– u-vector = (1, 0, 0)
Viewing Transformation

• Answer: (4, 1, -9)


Viewing Transformation
• What are the viewing coordinates of the
projected point? (also called projection
coordinates)
• Answer: Intersect line from (0, 0, 0) to
(4, 1, -9) with plane n = -4
Projection

• How do we plot a 3D point in the display screen which is


two-dimensional?
Projection

• By projecting the point from 3D to 2D


• We can consider this calculation as a transformation (and
use matrices)
• There are two main types of projection:
– Perspective Projection
– Parallel Projection
Projection Transformation

• Computes the projection coordinates of a point given its


viewing coordinates
Parallel Projection

• The projected point (up,vp,np) has coordinates (Pu,Pv,-d)


• Solve for the [parallel] projection coordinates given the viewing
coordinates earlier = (4, 1, -9)
Orthographic Parallel Projection

• If view plane
normal is
aligned to one
of the axes,
simply ignore
that axis
Oblique Parallel Projection
Oblique Parallel Projection
Oblique Parallel Projection
Oblique Parallel Projection
Oblique Parallel Projection
Oblique Parallel Projection
Isometric Projection

• All three axes are equally foreshortened allowing


measurements along the axes to be made with the same
scale
Isometric Projection

• For example when taking a cube,


– Look straight towards one face
– Rotate the cube ±45º about the vertical axis
– Rotate by approximately 35.264º (or arcsin(tan(30º)) about the
horizontal axis
– Then perform an orthographic projection to the x-y plane
Perspective Projection

• Two cases for the one-point projection:


– Case 1: Center of projection on the negative z-axis with viewplane
in the x-y plane

– Case 2: Center of projection at the origin with viewplane parallel to


the x-y plane a distance d from the origin
Derivation for Case 1
Perspective Transformation

• From similar triangles in the second figure, we can


see that
• vp/-d = Pv/Pn
• Thus, vp = -Pvd/Pn
• Similarly up = -Pud/Pn
Perspective Transformation

• vp = -Pvd/Pn
• up = -Pud/Pn
Can be expressed in matrix form as:

Homogeneous Cartesian
coordinates coordinates
Perspective Transformation

• Solve for the [perspective] projection coordinates given the


viewing coordinates (4, 1, -9)

You might also like