geometric projections - unc charlotte · projection type (parallel or perspective) prp - point in...
Post on 06-Apr-2020
3 Views
Preview:
TRANSCRIPT
Geometric Projections
PLANAR
PARALLEL PERSPECTIVE
OBLIQUE ORTHOGRAPHIC
AXONOMETRIC� MULTI−VIEW
1−pt 2−pt�
3−pt�
ISOMETRIC DIMETRIC TRIMETRIC�
� Parallel Projection: projectors are parallel to each other.
� Perspective Projection: projectors converge to a point.
ITCS 4120/5120 1 Geometric Projections
ITCS 4120/5120 2 Geometric Projections
Perspective Projection
◦ Projectors converge to a point, the center of projectionITCS 4120/5120 3 Geometric Projections
Parallel Projection
◦ Projectors are parallel meeting at infinityITCS 4120/5120 4 Geometric Projections
Orthographic Projection
◦ Projectors are orthogonal to the projection plane
ITCS 4120/5120 5 Geometric Projections
Multi-View Orthographic Projection
◦ projectors are also aligned with principal axes, common in architec-tural drawings (Top, Side and Front Views)
FRONT VIEW
SIDE VIEW
TOP VIEW�
ITCS 4120/5120 6 Geometric Projections
Axonometric Projections
� View plane Normal not aligned with principal axes.
� Useful in revealing 3D nature of objects, but does not preserveshape.
� Classified into Isometric, Dimetric, Trimetric projections
� Isometric projections are the most common.
ITCS 4120/5120 7 Geometric Projections
Isometric Projections
◦ View Plane Normal makes equal angles with all principal axes.ITCS 4120/5120 8 Geometric Projections
Oblique Projections
Combines the advantages of orthographic and axonometric projec-tions.
� Viewpoint is off the VPN axis.
� Line joining the viewpoint to the projection point is at an angle α.
� projectors are still orthogonal to the viewplane.
� Special Cases:
⇒ Cabinet: tanα = 1.0
⇒ Cavalier tanα = 0.5
ITCS 4120/5120 9 Geometric Projections
Oblique Projections
ITCS 4120/5120 10 Geometric Projections
Perspective Projections
� Classifed as 1-Point, 2-Point and 3-Point Perspective
A� B
CD
E F
GH
VP�
Vanishing Point
⇒ Lines and faces recede from a view and converge to a point, knownas a vanishing point.
⇒ Parallel edges converge at infinity, eg. AD,BC.ITCS 4120/5120 11 Geometric Projections
Perspective Projections:1-Point Perspective
ITCS 4120/5120 12 Geometric Projections
Perspective Projections:1-Point Perspective
ITCS 4120/5120 13 Geometric Projections
Perspective Projections:1-Point Perspective
ITCS 4120/5120 14 Geometric Projections
Perspective Projections:1-Point Perspective
ITCS 4120/5120 15 Geometric Projections
Perspective Projections: 2, 3 point Perspective
VP�
2�
VP�
1
X�
Y�
Z�
VP�
2�
VP� 1
X�
Y�
Z�
VP�
3�
ITCS 4120/5120 16 Geometric Projections
ITCS 4120/5120 17 Geometric Projections
ITCS 4120/5120 18 Geometric Projections
Perspective Projections:2-Point Perspective
ITCS 4120/5120 19 Geometric Projections
ITCS 4120/5120 20 Geometric Projections
ITCS 4120/5120 21 Geometric Projections
ITCS 4120/5120 22 Geometric Projections
ITCS 4120/5120 23 Geometric Projections
Geometry of Perspective Projection
Eye( eu, ev, en)
P(pu, pv, pn)
P’
Projection Plane
Problem:
To determine ~P ′, the projection of the ~P (pu, pv, pn),a point on the object, given the view point E(eu, ev, en),and ~N , the view plane normal (VPN).
Simplification:
⇒ The View Plane contains the origin.ITCS 4120/5120 24 Geometric Projections
Geometry of Perspective Projection
Eye(eu, ev, en) N
Projection Plane
t = 0
t = 1
P(pu, pv, pn)
P’
n = 0
pn(t) = en + t(pn − en)
pn(t′) = en + t′(pn − en) = 0
Hence t′ = en
en−pn
Projection Point:P ′u(t
′) = eu + t′(pu − eu)= eu + en
en−pn(pu − eu) = enpu−eupn
en−pn
Similarly,P ′v(t
′) = enpv−evpn
en−pn
ITCS 4120/5120 25 Geometric Projections
Geometry of Perspective Projection
Simplification: ~E is on the ~N axis.
~E = (eu, ev, en) = (0, 0, en)So
P ′ =(
enpu
en−pn, enpv
en−pn
)=(
pu
1−pn/en, pv
1−pn/en
)Thus P ′ projects to the 2D point
(p′u, p′v) =
(pu
1−pn/en, pv
1−pn/en
)ITCS 4120/5120 26 Geometric Projections
Perspective Projection Destroys DepthInformation!
Eye (eu, ev, en)
Projection Plane
P2(x1, y1, z1)
P2(x2, y2, z2)
P’
All points on the projector project to the same point ~P ′Assume ~a to be any point on the projector.
P (t) = ~e + t(~a− ~e)
P ′u(t) = pu
1−pn/en(eu = ev = 0)
= eu+t(au−eu)1−(en+t(an−en))/en
= au
1−an/en
Similarly,P ′v(t) = av
1−an/en
ITCS 4120/5120 27 Geometric Projections
Pseudo Depth
“Need to retain depth information after projection for use in shading and visiblesurface calculations.”
Define pn′ = pn
1−pn/en, as a measure of P ’s depth.
As pn increases, pn′ increases.
Hence
(pu′, pv
′, pn′) =
(pu
1−pn/en, pv
1−pn/en, pn
1−pn/en
)In Homogeneous coordinates,
P ′ = (pu, pv, pn, 1− pn/en)
= ~Mp
[pu pv pn 1
]TITCS 4120/5120 28 Geometric Projections
Perspective Projection
Mp =
1 0 0 00 1 0 00 0 1 00 0 −1/en 1
which is the perspective projection transform.
ITCS 4120/5120 29 Geometric Projections
Perspective Projection: General Case
If ~E is off the ~N axis
P ′ = MpMs~P
and,
Ms =
1 0 −eu/en 00 1 −ev/en 00 0 1 00 0 0 1
⇒ Moving ~E off the ~N axis introduces a shear, given by Ms
ITCS 4120/5120 30 Geometric Projections
View Space Operations
Back Face Elimination
Compare the orientation of the polygon with the view point (or center ofprojection). Define
~Np = polygon normal~N = vector to view point
visibility = ~Np • ~N > 0
ITCS 4120/5120 31 Geometric Projections
View Volume
xv = ±hzv
d
yv = ±hzv
d
NoteClipping is more efficiently carried out in screen coordinates.
ITCS 4120/5120 32 Geometric Projections
3D Screen Space
Perspective ProjectionP(xv, yv, zv)
(xs,ys)
d
xs = dxv/zv, ys = dyv/zv
In homogeneous coordinates,
X = xv, Y = yv, Z = zv, w = zv/d
Mpersp =
1 0 0 00 1 0 00 0 1 00 0 1/d 0
ITCS 4120/5120 33 Geometric Projections
Perspective Transformation
zv
yv
xv
zv
yv
xv
xs =dxv
hzv
ys =dyv
hzv
zs =f (1− d/zv)
f − dITCS 4120/5120 34 Geometric Projections
Perspective Transformation
In homogeneous coordinates,
X = (d/h)xv, Y = (d/h)yv, Z =fzv
f − d− df
f − d, w = zv
and
Mpersp =
d/h 0 0 00 d/h 0 00 0 f/(f − d) −df/(f − d)0 0 1 0
ITCS 4120/5120 35 Geometric Projections
Perspective Transformation
Mpersp =
1 0 0 00 1 0 00 0 f/(f − d) −df/(f − d)0 0 1 0
d/h 0 0 0
0 d/h 0 00 0 1 00 0 0 1
= Mpersp2Mpersp1
Note:
⇒ Mpersp1 converts a truncated pyramid to a regular pyramid (unitslopes for the side planes)
⇒ Mpersp2 maps the regular pyramid into a box.
ITCS 4120/5120 36 Geometric Projections
Perspective Transformation
Consider the following points:
⇒ (0, h, d, 1) −→ (0, d, d, 1) −→ (0, d, 0, d)
⇒ (0,−h, d, 1) −→ ??
⇒ (0, fh/d, f, 1)??
⇒ (0,−fh/d, f, 1) −→ ??ITCS 4120/5120 37 Geometric Projections
PHIGS Viewing System
� A View Reference Coordinate (VRC) system.
� View Reference Point (VRP) - origin of VRC
� Projection Reference Point (PRP) - center of projection
� Allows oblique projections (center of proj. to center of view plane isnot parallel to View Plane Normal (VPN)
� Near, Far clipping planes and projection plane defined.
� Projection window of any aspect ratio and located anywhere in theview plane.
ITCS 4120/5120 38 Geometric Projections
View Orientation
� VRP - point in World coords.
� VPN - vector in World coords.
� View Up (VUV) - vector in world coords.
~U = ~V UV × ~V PN~V = ~V PN × ~U
ITCS 4120/5120 39 Geometric Projections
View Mapping
� Projection type (parallel or perspective)
� PRP - point in VRC space
� View plane distance - in VRC space
� Front and Back plane distances
� View plane window size (4 limits)
� Projection viewport limits in normalized projection space (4 limits)
ITCS 4120/5120 40 Geometric Projections
Normalizing Transformation
� Translate PRP to the origin.
After translation,
� View plane distance = d
� Near plane distance = n
� Far plane distance = f
� Window parameters,
⇒ umax, umin become xmax, xmin
⇒ vmax, vmin become ymax, ymin
ITCS 4120/5120 41 Geometric Projections
Shear Projection Window Center
Shear the center of the projection window such that the center line be-comes the zv axis.
Msh =
1 0 xmax+xmin
2d0
0 1 ymax+ymin
2d0
0 0 1 00 0 0 1
ITCS 4120/5120 42 Geometric Projections
Scale into symmetric (unit slope) view volume
Ms =
2d
xmax−xmin0 0 0
0 2dymax−ymin
0 00 0 1 00 0 0 1
ITCS 4120/5120 43 Geometric Projections
Perspective Transformation
Mpersp =
1 0 0 00 1 0 00 0 f/(f − n) −fn/(f − n)0 0 1 1
ITCS 4120/5120 44 Geometric Projections
Normalizing Transformation - Properties
� Planes are preserved.
� Planes parallel to the view plane are shifted.
� The 4 sidewalls of the view volume become 4 faces of a paral-lelepiped, view point is at infinity.
� Also known as pre-warping.
� Useful for visible surface calculations.
ITCS 4120/5120 45 Geometric Projections
Clipping in 3D
N
U or V
F
B
U=N o
r V =
N
U=−N or V=−N
(1, 1)
N
View Space� Clipping Space
nmin
U or V
View�
Plane
Clip boundaries are as follows:
−gn ≤ gu ≤ gn
−gn ≤ gv ≤ gn
nmin ≤ gn ≤ 1
Use the Cohen-Sutherland Algorithm with these boundaries definingthe clip volume.
ITCS 4120/5120 46 Geometric Projections
Cohen-Sutherland Clipping Algorithm
� Extension of the 2D algorithm to 3D.
� Note that the scaling to unit slope planes facilitates efficient clippingin 3D.
⇒ gu > −gn - Point to right of volume
⇒ gu < gn - Point to left of volume
⇒ gv > −gn - Point above volume
⇒ gv < gn - Point below volume
⇒ gn < nmin - Point in front of volume
⇒ gn > 1 - Point behind volume
ITCS 4120/5120 47 Geometric Projections
3-D Clipping in Homogeneous Coordinates
X
Y
Z
U
V
N
(rx, ry, rz)(0, 0, 0)
P(x, y, z)Q(a,b,c)
World Coords Camera Coords
−1 ≤ gu
gw
≤ 1,−1 ≤ gv
gw
≤ 1, 0 ≤ gn
gw
≤ 1
OR
−gw ≤ gu ≤ gw,−gw ≤ gv ≤ gw, 0 ≤ gn ≤ gw
Equalities reverse if gw ≤ 0.0ITCS 4120/5120 48 Geometric Projections
Clipping Points and Lines
U or V
W = 1�
W�
P1’
P2’
W= −U or W = −V� W= U or W = V
�
P1
Projection of P1,P1’
� If gw component is negative, multiply through by -1, then clip.
� Same procedure when both endpoints of a line have negative gw
� When endpoints of a line have opposite gw, what do we do??
ITCS 4120/5120 49 Geometric Projections
Clipping Points and Lines
U or V
W = 1�
W�
P1
P1’
P2
P2’
W= −U or W = −V� W= U or W = V
�
� P1 and P2 are on opposite side of W = 0 plane.
� The projection of P1P2 has 2 parts; one segment extends to −∞,the other to +∞.
� Solution: Clip twice, once with each region.
� Better, Clip with top region, negate end points, and clip again withtop region - Need to have only 1 clip region.
ITCS 4120/5120 50 Geometric Projections
top related