Graphics 1159.235
Projections
Graphics 2159.235
Demo
Graphics 3159.235
Projections - Outline
• 3D Viewing• Coordinate System & Transform Process• Generalized Projections• Taxonomy of Projections• Perspective Projections• Parallel Projections
Graphics 4159.235
3D Viewing• Inherently more complex than 2D case.
– Extra dimension to deal with– Most display devices are only 2D
• Need to use a projection to transform 3D object or scene to 2D display device.
• Need to clip against a 3D view volume.– Six planes.– View volume probably truncated pyramid
Graphics 5159.235
Coordinate Systems & Transform Process
Object coordinate systems.
World coordinates.
View Volume
Screen coordinates.
Raster
Transform
Project
Clip
Rasterize
Graphics 6159.235
Viewing Coordinate System
yw
zw
xw
world
P0
xv
yv
zv
Viewing plane
Viewer System
Body System
Front-Wheel System
View Window
View Plane
Graphics 7159.235
Specifying the Viewing Coordinate System
• Viewing Coordinates system, [xv, yv, zv], describes 3D objects with respect to a viewer.
• A viewing plane (projection plane) is set up perpendicular to zv and aligned with (xv,yv).
• In order to set a viewing plane we have to specify:
Graphics 8159.235
ywxw
zw
LN
v
• P=(Px,Py,Pz) is a point where a camera is located.
• L - is a point to look-at.• V - is the view up vector, whose projection
onto the view-plane is directed up.
P
xv
yv
zv
Viewing plane
Graphics 9159.235
Viewing Window• After objects were projected onto the viewing plane,
an image is taken from a Viewing Window.• A viewing window can be placed anywhere on the
view plane.• In general the view window is aligned with the
viewing coordinates and is defined by its extreme points: (l,b) and (r,t)
yv
xv
zv
View plane
View window
(l,b)
(r,t)
Graphics 10159.235
Viewing Volume• Given the specification of the viewing window, we can
set up a Viewing Volume.• Only objects inside the viewing volume will appear in
the display, the rest are clipped.
Graphics 11159.235
• In order to limit the infinite viewing volume we define two additional planes: Near Plane and Far Plane.
• Only objects in the bounded viewing volume will appear.
• The near and far planes are parallel to the viewing plane and specified by znear and zfar.
• A limited viewing volume is defined:
– For orthographic: a rectangular parallelpiped.
– For oblique: an oblique parallelpiped.
– For perspective: a frustum.zv
NearPlane
FarPlane
window
windowzv
NearPlane
FarPlane
Graphics 12159.235
• The Viewing Plane can be placed anywhere along the Zv axis, as long it does not contain the center of projection.
window
zv
NearPlane
FarPlane
Graphics 13159.235
Defining the viewing Volume
zv
far
near
yv
xv
left
righttop
bottom
zv
far
near
yv
xv
left
righttop
bottom
Graphics 14159.235
Generalised Projections.
• Transforms points in a coordinate system of dimension n into points in one of less than n (ie 3D to 2D)
• The projection is defined by straight lines called projectors.
• Projectors emanate from a centre of projection, pass through every point in the object and intersect a projection surface to form the 2D projection.
Graphics 15159.235
Projections.
• In graphics we are generally only interested in planar projections – where the projection surface is a plane.– Most cameras employ a planar film plane.
We will only deal with geometric projections – the projectors are straight lines.
• Whether rays coming form object converges to COP or not
Graphics 16159.235
Projections.• Henceforth refer to planar geometric projections as just:
projections.• Two classes of projections :
– Perspective.– Parallel.
A
B
A
B
A
B
A
B
Centre ofProjection.
Centre of Projectionat infinity
Parallel
Perspective
Parallel
Graphics 17159.235
Projections• Viewing 3D objects on a 2D display requires a
mapping from 3D to 2D.
• Projectors are lines from the center of projection through each point in the object.
• A projection is formed by the intersection of the projectors with a viewing plane.
Center of Projection
Projectors
Graphics 18159.235
• Center of projection at infinity results with a parallel projection.( projection lines are parallel)
• A center of projection at a finite distance results with a perspective projection. (projection lines converges to COP)
Graphics 19159.235
• A parallel projection preserves relative proportions of objects, but does not give realistic appearance (commonly used in engineering drawing).
• A perspective projection produces realistic appearance, but does not preserve relative proportions.
Graphics 20159.235
A Taxonomy of ProjectionsPlanar geometric projections.
Parallel Perspective
Orthographic Oblique 1 point
2 point
3 point
Axonometric
Isometric
CavalierCabinet
Multi View
Graphics 21159.235
• Parallel Projection
Projection lines (projectors) are parallel not converges
Converges at infinity, COP is infinity
Preserve the shape not used for realistic images
Parallel line intersect perpendicularly to projection plane-Orthographic Projection
When parallel line intersect plane at some angle not perpendicular –Oblique
Graphics 22159.235
• When parallel line perpendicularly intersect and View plane is parallel to principal plane (perpendicular to axies ) of object space-Multi view projection (shows one face of object-top, bottom, left, right, front, rear) it includes 2 dimensions(Lxb, bxh, hXL)
• When parallel line perpendicularly intersect and View plane is not parallel to principal Plane( not perpendicular to principal axies) of object space-Axonometric projection (isometric, diametric, trimetric) it includes 3 dimensions(Lxbxh) projectors makes equal angel with all three principal axies –isometric
• Multi view and orthographic combination provide 3 faces can be seen TFRi, BLRe
Graphics 23159.235
• In oblique projection only the face of object is parallel to view plane are shown, their shape, size, length, angle are preserved for these faces only, phases not parallel discarded. In oblique projection Line which is perpendicular to plane is shorter in length of actual line (projection rays )change in length of projected line is –foreshortening factor f
• When f=0 projection is orthographic (cot 90=0) angle between projector and plane is 90
• When f=1 then oblique projection is Cavalier projection(cot45=1) angle between projector and plane is 45
• When f=1/2 then oblique projection is cabinet projection or break front or cupboard (cot63.435=1/2) angle is 63.435
Graphics 24159.235
Parallel Projections
• Specified by a direction to the centre of projection, rather than a point.– Centre of projection at infinity.
• Orthographic– The normal to the projection plane is the same as the
direction to the centre of projection.• Oblique
– Directions are different.
A
B
A
BCentre of Projectionat infinity
Parallel
Graphics 25159.235
Parallel Projection• Projectors are all parallel.
• Orthographic: Projectors are perpendicular to the projection plane.
• Oblique: Projectors are not necessarily perpendicular to the projection plane.
Orthographic Oblique
Graphics 26159.235
• Since the viewing plane is aligned with (xv,yv), orthographic projection is performed by:
Orthographic Projection
11000
0000
0010
0001
1
0
1
0 v
v
v
v
v
p
p
z
y
x
y
x
y
x
P0
xv
yv
zv
(x,y,z) (x,y)
Graphics 27159.235
• Lengths and angles of faces parallel to the viewing planes are preserved (Plan View).
• Problem: 3D nature of projected objects is difficult to deduce.
Front view
Top View
Side View
Graphics 28159.235
• Orthographic: Projector is perpendicular to view plane
• Oblique: projector is not perpendicular to view plane
• Multi view: View plan parallel to principal planes
• Axonometric : View plane not parallel to principal planes
Graphics 29159.235
Orthographic Projections
Most common orthographicProjection :
Front-elevation,Side-elevation,Plan-elevation.
Angle of projection parallel to principal axis; projection plane is perpendicular to axis.
Commonly used in technical drawings
Graphics 30159.235
Orthographic Projection
1000
0000
0010
0001
orthM
Orthographic Projection onto a plane at z = 0.
xp = x , yp = y , z = 0.
Graphics 31159.235
Axonometric Orthographic Projections
• Projection plane not parallel to principal Plane (not perpendicular to principal axis) normal of plane makes various angle axies
• Show several faces of the object at once• Foreshortening is uniform rather than being
related to distance(shortening factor f )• Parallelism of lines is preserved• Distances can be measured along each principal
axis ( with scale factors )
Graphics 32159.235
Isometric Projection• Most common axonometric projection• Projection plane normal makes equal
angles with each axis.• i.e normal is (dx,dy,dz), |dx| = |dy|=|dz|
Graphics 33159.235
Isometric Projection
Normal
x
z
y
ProjectionPlane
y
z x
120º
120º
120º
All 3 axes equally foreshortened- measurements can be made- Hence the name iso-metric
Graphics 34159.235
Oblique projections.
• Projection plane normal differs from the direction of projection.
• Usually the projection plane is parallel to a principal axis.– Other faces can measure distance, but not
angles.– Parallel rays intersect view plane at angle β
Graphics 35159.235
• cavalier projection :– Preserves lengths of lines perpendicular to the
viewing plane.– 3D nature can be captured but shape seems
distorted.– Can display a combination of front, side, and top
views.
Cabinet projection:– lines perpendicular to the viewing plane project at
1/2 of their length.– A more realistic view than the cavalier projection.– Can display a combination of front, side, and top
views.
Graphics 36159.235
Oblique projection
x
z
y
ProjectionPlane
NormalParallel to x axis
Graphics 37159.235
Geometry of Oblique Projections
Projection plane is x,y plane
L=1/tan()
b - angle between plane and projection direction
- Determines the type of projection
is choice of horizontal angle.
Given a desired L and ,Direction of projection is
(L.cos, L.sin,-1)
z
y
x
P´
L
P=(0,0,1)
L.sin
L.cos
Graphics 38159.235
Geometry of Oblique Projections
• Point P=(0,0,1) maps to:
P’=(l.cosa, l.sina, 0) on xy plane,
and P(x,y,z) onto P’(xp,yp,0)
)sin(
)cos(
lzyy
lzxx
p
p
1000
0000
0sin10
0cos01
l
l
M oband
Graphics 39159.235
Oblique Projection• Projectors are not perpendicular to the viewing plane.
• Angles and lengths are preserved for faces parallel to the plane of projection.
• preserves 3D nature of an object.
yv
(x,y,z)
(x,y)
xv
(xp,yp)
Graphics 40159.235
=45o =30o
=45o =30o
cavalier Projections (=45o) of a cube for two values of angle
Cabinet Projections (= 63.4o) of a cube for two values of angle
1
1
11
1
1
1
1
0.5 1
1
0.5
Several Oblique Projections
Graphics 41159.235
Perspective Projections.• Defined by projection plane and centre of projection.
• Visual effect is termed perspective foreshortening. – The size of the projection of an object varies
inversely with distance from the centre of projection.
– Similar to a camera - Looks realistic !• Not useful for metric information
– Angles only preserved on faces parallel to the projection plane.
– Distances not preserved
Graphics 42159.235
Perspective Projections
• A set of lines not parallel to the projection plane converge at a vanishing point.– point at infinity.– Homogeneous coordinate is 0
(x,y,0)
Graphics 44159.235
Perspective Projections
z
x
y
Projection plane
xz
y
• Lines parallel to a principal axis converge at an axis vanishing point. – Categorized according to the number of such points – Corresponds to the number of axes cut by the projection plane.
Graphics 45159.235
Painless Perspective
Graphics 46159.235
Why do parallel lines seem to converge?
Graphics 47159.235
The eye as a camera
Graphics 48159.235
The eye as a camera
Graphics 49159.235
Equal distances appear smaller
Graphics 50159.235
Simplified camera
Graphics 51159.235
View planeView plane
Simplified camera
Z-axisZ-axis
Graphics 52159.235
Perspective
The first ever painting (Trinity with the Virgin, St. John and Donors) done in perspective by Masaccio, in 1427.
Graphics 53159.235
Graphics 54159.235
1-Point Projection
Projection plane cuts 1 axis only.
Graphics 55159.235
1-Point Perspective
A painting (The Piazza of St. Mark, Venice) done by Canaletto in 1735-45 in one-point perspective
Graphics 56159.235
2-Point Perspective
y
z x
Projection plane
Graphics 57159.235
2-Point Perspective
Painting in two point perspective by Edward Hopper The Mansard Roof 1923 (240 Kb); Watercolor on paper, 13 3/4 x 19 inches; The Brooklyn Museum, New York
Graphics 58159.235
3-Point PerspectiveGenerally held to add little beyond 2-point perspective.
y
z x
Projection plane
A painting (City Night, 1926) by Georgia O'Keefe, that is approximately in three-point perspective.
Graphics 59159.235
Vanishing Points• There are infinitely many general vanishing
points.
• There can be up to three principal vanishing points (axis vanishing points).
• Perspective projections are categorized by the number of principal vanishing points, equal to the number of principal axes intersected by the viewing plane.
• Most commonly used: one-point and two-points perspective.
Graphics 60159.235
x
y
z
One point (z axis) perspective projection
Two pointsperspective projection
z axis vanishing point.
x axis vanishing point.
Graphics 61159.235
• Using similar triangles it follows: consider xz plane
xy
z
(x,y,z)
(xp,yp,0)
center of projection
d
dz
y
d
y
dz
x
d
x pp
;
d
x
-z
(x,y,z)
xp
0;;
ppp zdz
ydy
dz
xdx
Preserve the angle
Graphics 62159.235
• Thus, a perspective projection matrix is defined:
11
00
0000
0010
0001
d
M per
d
dz
y
x
z
y
x
d
PM per 0
111
00
0000
0010
0001
0;;
ppp zdz
ydy
dz
xdx
Graphics 63159.235
Finding Vanishing Points
• Recall : An axis vanishing point is the point where the axis intercepts the projection plane point at infinity.
Tvpxp 0001
:point by themultiply
point, vanishingaxis x find toE.g
e.perspectivpoint 1 a have weSo
00
01/d00
0100
0010
0001
:n formulatio For this
dP
P
P
M
zvp
yvp
xvp
per
Graphics 64159.235
Mathematics of Viewing
• Need to generate the transformation matrices for perspective and parallel projections
• Should be 4x4 matrices to allow general concatenation
Graphics 65159.235
Perspective Projection – Simplest Case
d
x
y
z
ProjectionPlane.
P(x,y,z)
Pp(xp,yp,d)
Centre of projection at the origin,Projection plane at z=d.
Graphics 66159.235
Perspective Projection – Simplest Case
d
x
y
z
P(x,y,z)
Pp(xp,yp,d)
z
P(x,y,z)
d
z
P(x,y,z)
d
y
x
xp
yp
dz
y
z
ydy
dz
x
z
xdx
z
y
d
y
z
x
d
x
pp
pp
/ ;
/
;
:trianglessimilarFrom
Graphics 67159.235
Perspective Projection
01/d00
0100
0010
0001
:matrix 4x4 a as drepresente becan ation transformThe
perM
TTT
pp dzzyxdz
ydz
xddyx
1..1
Graphics 68159.235
Perspective Projection
TT
perp
Tp
dzzyxWZYX
z
y
x
PMP
WZYXP
/
101/d00
0100
0010
0001
point projected general theRepresent
Graphics 69159.235
Perspective Projection
ddz
y
dz
x
W
Z
W
Y
W
X
dzzyxP Tp
,/
,/
,,
: 3D back to come W toDropping
/Trouble with this formulation :
Centre of projection fixed at the origin.
Graphics 70159.235
Alternative Formulation
z
P(x,y,z)
d
x
xp
z
P(x,y,z)
d
y
yp
Projection plane at z = 0Centre of projection at z = -d
1)/( ;
1)/(
dby Multiply
;
:trianglessimilarFrom
dz
y
dz
ydy
dz
x
dz
xdx
dz
y
d
y
dz
x
d
x
pp
pp
Graphics 71159.235
Alternative Formulation
11/d00
0000
0010
0001
perM
z
P(x,y,z)
d
x
xp
z
P(x,y,z)
d
y
yp
Projection plane at z = 0,Centre of projection at z = -d
Now we can allow d
Graphics 72159.235
Perspective Projection• In a perspective projection, the center of projection is
at a finite distance from the viewing plane.• The size of a projected object is inversely proportional
to its distance from the viewing plane.• Parallel lines that are not parallel to the viewing plane,
converge to a vanishing point. • A vanishing point is the projection of a point at
infinity.
Z-axis vanishing pointy
x
z
Graphics 73159.235
Graphics 74159.235
Observations• Mper is singular (|Mper|=0), thus Mper is a many to one
mapping.
• Points on the viewing plane (z=0) do not change.
• The homogeneous coordinates of a point at infinity directed to (Ux,Uy,Uz) are (Ux,Uy,Uz,0). Thus, The vanishing point of parallel lines directed to (Ux,Uy,Uz) is at [dUx/Uz, dUy/Uz].
• When d, Mper Mort
Graphics 75159.235
What is the difference between moving the center of projection and moving the projection plane?
Center of Projection
zProjectionplane
Center of Projection
zProjectionplane
Center of Projection
zProjectionplane
Original
Moving the Center of Projection
Moving the Projection Plane