Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
17 views61 pages

Projections L1

The document discusses different types of projections used to transform 3D objects into 2D representations. It describes perspective projection, where points are projected along lines that meet at a central point, creating effects like foreshortening. Parallel projection is also covered, including orthographic projection where parallel lines remain parallel and angles are preserved. Key concepts like vanishing points, where parallel lines appear to converge, are explained. The document provides visual examples and mathematical representations of different projection types and their properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views61 pages

Projections L1

The document discusses different types of projections used to transform 3D objects into 2D representations. It describes perspective projection, where points are projected along lines that meet at a central point, creating effects like foreshortening. Parallel projection is also covered, including orthographic projection where parallel lines remain parallel and angles are preserved. Key concepts like vanishing points, where parallel lines appear to converge, are explained. The document provides visual examples and mathematical representations of different projection types and their properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Projections

Dr. R. Srivastava
Projection
Projection

Conceptual model of 3D viewing process


Projection
• In general, projections transform points in a coordinate system of
dimension n into points in a coordinate system of dimension less
than n.

• We shall limit ourselves to the projection from 3D to 2D.

• We will deal with planar geometric projections where:


 The projection is onto a plane rather than a curved surface
 The projectors are straight lines rather than curves
Projection

▪ key terms…
 Projection from 3D to 2D is defined by straight projection rays
(projectors) emanating from the 'center of projection', passing
through each point of the object, and intersecting the 'projection
plane' to form a projection.
Planer Geometric Projection

• 2 types of projections
– perspective and parallel.

• Key factor is the center of projection.


– if distance to center of projection is finite : perspective
– if infinite : parallel
A

A
Projectors
A' B

Projectors B
A'

B'
B'

Projection Projection
plane Center of plane
Center of projection Direction
projection at infinity of
projection

Perspective projection Parallel projection


Perspective v Parallel
• Perspective:
– visual effect is similar to human
visual system...
– has 'perspective foreshortening'
• size of object varies inversely with
distance from the center of projection.
– Parallel lines do not in general
project to parallel lines
– angles only remain intact for faces
parallel to projection plane.
Perspective v Parallel

• Parallel:
– less realistic view because of no
foreshortening
– however, parallel lines remain
parallel.
– angles only remain intact for faces
parallel to projection plane.
Perspective projection- anomalies

• Perspective foreshortening The farther an object is from COP


the smaller it appears C

D
C'
A' B
D'

Projectors
B'

Center of Projection
projection plane

Perspective foreshortening
Perspective projection- anomalies

• Vanishing Points: Any set of parallel lines not parallel to the view plane
appear to meet at some point.
– There are an infinite number of these, 1 for each of the infinite
amount of directions line can be oriented
z-axis vanishing point

Vanishing point
Perspective projection- anomalies

• View Confusion: Objects behind the center of projection are projected


upside down and backward onto the view-plane

• Topological distortion: A line segment joining a point which lies in front of


the viewer to a point in back of the viewer is projected to a broken line of
infinite extent.
P1 P'3

Plane containing
Y P3
Center of Projection (C)
C

P2
View Plane
P'1
P'2

Z
Vanishing Point

Vanishing Point
COP

View Plane
Vanishing Point

• If a set of lines are parallel to one of the three axes, the vanishing point is
called an axis vanishing point (Principal Vanishing Point).
– There are at most 3 such points, corresponding to the number of axes
cut by the projection plane
• One-point:
– One principle axis cut by projection plane
– One axis vanishing point
• Two-point:
– Two principle axes cut by projection plane
– Two axis vanishing points
• Three-point:
– Three principle axes cut by projection plane
– Three axis vanishing points
Vanishing Point
Vanishing Point
• One point perspective projection of a cube
– X and Y parallel lines do not converge
Vanishing Point
Vanishing Point

• Two-point perspective
projection:

– This is often used in architectural,


engineering and industrial design
drawings.

– Three-point is used less frequently


as it adds little extra realism to that
offered by two-point perspective
projection.
Vanishing Point

H VPL VPR

VP1 VP2

VP3
Projective Transformation

y
plane of
projection

d
center of
projection
x

view direction

Settings for perspective projection


Projective Transformation
plane of
projection
P(y,z)
y

y
P'(y p,zp)
z
d
-z

y yp y
=  yp =
−z d − (z d )
z = −d
 
(x, y, z,1)   x
,
y
,−d ,1
 − (z d ) − (z d ) 
Projective Transformation
 x 
? ? ? ?  x   − ( z / d )  ? ? ? ?  x   x 
       
? ? ? ?  y   y  ? ? ? ?  y   y 
= = z 
? ? ? ? z   − (z / d )  ?   
   z 
? ? ? z
    − d  
? ?  1   ?
 ? ?   ? ? ?  1   − 
 1   d
 

 x 
 x   
   − (z d )  1

0 0 0  x   x 
   
 y  perspectiv e
 y 
 z  ⎯⎯ ⎯⎯→
division 0 1 0 0  y   y 
( ) 
 z 
− z d

0 0 1 0  z  =  z 
    z 
−   −d  0 0 −
1
0  1   − 
 d  1 
   d   d
Parallel projection
• 2 principle types:
– orthographic and oblique.

• Orthographic : n

– direction of projection =
normal to the projection
plane.

• Oblique :
– direction of projection != n
normal to the projection
plane.
Orthographic projection
• Orthographic (or orthogonal) projections:
– front elevation, top-elevation and side-elevation.
– all have projection plane perpendicular to a principle axes.

• Useful because angle and distance measurements can be


made...

• However, As only one face of an object is shown, it can be


hard to create a mental image of the object, even when
several view are available
Orthographic projection
Orthogonal Projection Matrix
y

1 0 0 0  x   x 
plane of
projection     
0 1 0 0  y   y 
0    = 
0 0 0 z 0
    
0 0 0 1  1   1 
x
direction of
projection

view direction
z
Axonometric projection
• Axonometric Projections use projection planes that are not
normal to a principal axis.On the basis of projection plane
normal N = (dx, dy, dz) subclasses are:

o Isometric : | dx | = | dy | = | dz | i.e. N makes equal angles with all


principal axes.

o Dimetric : | dx | = | dy |

o Trimetric : | dx | != | dy | != | dz |
Axonometric vs Perspective

• Axonometric projection shows several faces of an object at


once like perspective projection.
• But the foreshortening is uniform rather than being related to
the distance from the COP.

Isometric proj

z Projection Plane
Oblique parallel projection

• Oblique parallel projections


– Objects can be visualized better then with
orthographic projections
– Can measure distances, but not angles
* Can only measure angles for faces of objects parallel to
the plane
• 2 common oblique parallel projections:
– Cavalier and Cabinet
Oblique parallel projection
y

Projection Plane

Projector x

Projection Plane Normal


Oblique parallel projection

• Cavalier:
– The direction of the projection makes a 45 degree angle
with the projection plane.
– There is no foreshortening
Oblique parallel projection

• Cabinet:
– The direction of the projection makes a 63.4 degree angle
with the projection plane. This results in foreshortening
of the z axis, and provides a more “realistic” view
Oblique parallel projection

• Cavalier, cabinet and orthogonal projections can all


be specified in terms of (α, β) or (α, λ) since
– tan(β) = 1/λ
λ sin(α)

P‫(׳‬λ cos(α), λ sin(α),0)


β
λ
α
P=(0, 0, 1)

λ cos(α)
Oblique parallel projection

l=1 b = 45 Cavalier projection a = 0 - 360

l=0.5 b = 63.4 Cabinet projection a = 0 – 360

l=0 b = 90 Orthogonal projection a = 0 – 360


Oblique parallel projection

y
PP‘ = (λ cos(α), λ sin(α),-1) = DOP
Proj(P) = (λ cos(α), λ sin(α),0) (xp , yp )

Generally ( x, y ) a

– multiply by z and allow for (non-zero) x and y x


x ‘ = x + z lcos a  x p = x + l cos a
y‘ = y + z lsin a y p = y + l sin a

 x   1 0 l cos a 0  x 
    
 y   0 1 l sin a 0  y 
 0  = 0 0 0 0 z. 
    
 1  0 1   1 
   0 0
Generalized Projection Matrix
x or y
Plane of Projection
Center of Projection
(COP)
Pp = (xp, yp, zp)

Q
P = (x, y, z)

(dx, dy, dz)

z
(0, 0, zp)

P = ( x, y , z )
x = Qd x + t ( x − Qd x )
Pp = COP + t (P − COP ), 0  t  1
(
y  = Qd y + t y − Qd y )
( ) (
COP = 0,0, z p + Q d x , d y , d z )
( ) (
z  = z p + Qd z + t z − z p + Qd z ( ))
Generalized Projection Matrix
dx d
x−z + zp x
dz dz
xp =
zp − z
+1
( ) ( (
z p = z p + Qd z + t z − z p + Qd z )) Qd z
z p − (z p + Qd z ) dy dy
t = y−z + zp
z − (z p + Qd z ) dz dz
yp =
zp − z
+1
Qd z
2
zp − z zp z p + z p Qd z
+1 −z +
Qd z Qd z Qd z
zp = zp =
zp − z zp − z
+1 +1
Qd z Qd z
Generalized Projection Matrix
dx d
x−z + zp x
dz dz
xp =  
zp − z 1 0 −
dx
zp
dx

+1
Qd z  dz dz 
 dy dy 
dy dy 0 1 − zp 
y−z + zp dz dz 
yp =
dz dz M gen =  2

zp − z zp zp
+1 0 0 − + zp 
Qd z  Qd z Qd z 
 1 zp 
zp
2
zp  0 0 − + 1 
−z + + zp  Qd z Qd z 
Qd z Qd z
zp =
zp − z
+1
Qd z
Generalized Projection Matrix
 dx 
dx
1 0 − zp 
 dz 
dz
 dy 
dy
0 1 − zp 
dz dz 
M gen =
 zp z 2p 
0 0 − + zp 
 Qd z Qd z 
 1 zp 
0 0 − +1 
 Qd z Qd z 
1 0 0 0
 
z p =− d , Q=d ,
d x = 0 , d y = 0 , d z =1
0 1 0 0
⎯⎯ ⎯ ⎯ ⎯⎯→ M per = 0 0 1 0
 1 
0 0 − 0
 d 
Generalized Projection Matrix
 dx dx
1 0 − zp 
 dz dz
 dy dy
0 1 − zp 
dz dz 
M gen =
 zp z 2p 
0 0 − + zp 
 Qd z Qd z 
 1 zp 
0 0 − +1 
 Qd z Qd z 
1 0 0 0
z p =0, Q = ,  
d x = 0 , d y = 0 , d z =1 0 1 0 0
⎯⎯ ⎯ ⎯ ⎯
⎯→ M par =
0 0 0 0
 
0 1 
 0 0
Taxonomy of Projection
Additional Material:
Projections-OpenGL
OpenGL’s Perspective Specification
aspect = w / h

y w

h
z 
x

near

far

y field-of-view / fovy
aspect ratio
near and far clipping planes
viewing frustum

gluPerspective(fovy, aspect, near, far)

glFrustum(left, right, bottom, top, near, far)


Perspective without Depth
1 0 0 0  x   x 
    
0 1 0 0  y   y 
0 0 1 0  z  =  z 
 1    z 
0 0 − 0  1   − 
 d   d
 x  • The depth information is
 x   
− (z d ) 
lost as the last two
   components are same
 y  perspectiv e
 y  • But dept information of the
 z  ⎯⎯ ⎯ ⎯→
division
− ( z d )  projected points is essential
 z   for hidden surface removal
−   −d  and other purposes like
 d  1  blending, shading etc.
 
Perspective without Depth
 x 
 
 − (z d ) 
1 0 0 0  x   x 
    
0 1 0 0  y  y  perspectiv e  y 
 
0 0 a  = 
b  z  az + b  ⎯⎯ ⎯⎯→ − ( z d ) 
division

      
 0 1    z   d (az + b ) 
0 − 0  1   −  −
 d   d   z 
 
 1 
d b
z  = −d  a −
z
For ß < 0, z’ is a monotonically increasing function of depth.
Canonical View Volume
y
far near

(-1,1,1) (-1,1,-1)

(1,1,-1)

(1,1,1)

(-1,-1,-1)

(-1,-1,1) x

(1,-1,1) (1,-1,-1)

−1  x  1
−1  y  1
−1  z  1
Canonical View Volume
z=-far

z=-near
y z=1 (far) y z=-1 (near)
+1

z viewer
z

-1
+1 -1

There is a reversal of the z- coordinates, in the sense that before


the transformation, points further from the viewer have smaller z-
coordinates
Perspective Matrix
The matrix to perform perspective transformation:

 0 0 0   x    x 
     
0  0 0   y    y 
0 0    = 
a b z a z+b
     
0 0 − 1 0   1   − z 

   x /(− z ) 
 
   y /(− z ) 
=
(a  z + b ) /(− z ) 
 
 
 1 
Perspective Matrix z = -far

z = -near
a=w/h

y w

θ/2 h
z
x

  − z z
c = cot   =  y =−
2 y c
w x az
a= =  x =ay =−
h y c
 az z 
 ( x , y , z )   − ,− , z 
 c c 
Perspective Matrix
z = -far

z = -near
a=w/h

y w

θ/2 h
z
x

 an n   af 
 − ,− ,− n  → (− 1,−1,−1)  − ,− ,− f  → (− 1,−1,1)
f
 c c   c c 
 an n   af f 
 − , ,−n  → (− 1,1,−1)  − , ,− f  → (− 1,1,1)
 c c   c c 
 an n   af 
 ,− ,− n  → (1,−1,−1)  ,− ,− f  → (1,−1,1)
f
 c c   c c 
 an n   af f 
 , ,−n  → (1,1,−1)  , ,− f  → (1,1,1)
 c c   c c 
Perspective Matrix
 an n 
 − ,− ,− n  → (− 1,−1,−1)
 c c 
 a 
 an   − 
  0 0 0   − c   − 1  c   − 1
     
 0  0 0   − n   − 1  −   − 1
 = 
 0 0 a b    c  =  − 1 c
     − an + b   − 1
 0 0 −1 0   − n   1    1
  
 1
  
  n   
 1 

 an  c
 −   − 1  =
 c    a
n   − 1
 − =  = c
 c   − 1
 − an + b     −an + b = −n
  1
 n 
Perspective Matrix
 af   a 
 − ,− ,− f  → (− 1,−1,1)
f
 − 
 c c   c   − 1
 −   − 1
 af   = 
  0 0 0   − c   − 1 c
       − af + b  1
 0  0 0   − f   − 1   1
 0 0 a b  c  =  1   f   
   
 0 0 −1 0   − f   1 
 1 
     
 1 

 −af + b = f
 af 
 −   − 1  −an + b = − n
 c   
f   − 1 f +n
 − =  a =
 c  −1 n− f
 − af + b   

  1 b =
2 fn
 f  n− f
Perspective Matrix

The matrix to perform perspective transformation:

c 
 0 0 0 
a 
0 c 0 0 
0 f +n 2 fn 
0
 n− f n− f 
0 −1 
 0 0 
Solved Problems
Generalized Projection
• Using the origin as the center of projection, derive the perspective
transformation onto the plane passing through the point R0(x0, y0, z0) and
having the normal vector N = n1I + n2J + n3K.

N = n1I + n2J + n3K

R0=x0 ,y0, z0
y P(x, y, z)

P'(x', y', z')

x
O
z
Generalized Projection

N = n1I + n2J + n3K


P'O = α PO
x' = αx, y' = αy, z ' = αz
R0=x0 ,y0, z0
y P(x, y, z)

N. R0P' = 0
n1x ' + n2y ' + n3z '
=n1x0 + n2y0 + n3z0 = d0
P'(x', y', z')

d0
a=
n1 x + n2 y + n3 z O x

z
 d0 0 0 0
 
0 d0 0 0
Per = 
0 0 d0 0
 
n 0 
 1 n2 n3
Generalized Projection
• Derive the general perspective transformation onto a plane with reference point
R0 and normal vector N and using C(a,b,c) as the center of projection.
N = n1I + n2J + n3K

R0=x0 ,y0, z0
y

P(x, y, z)

P'(x', y', z')


C

z
Generalized Projection

P'C = α PC
x' = α(x-a) + a N = n1I + n2J + n3K

n1x' + n2y' + n3z‘ = d0


R0=x0 ,y0,
y z0
d
a=
n1 ( x − a ) + n2 ( y − b) + n3 ( z − c)
P(x, y, z)

d = (n1x0 + n2y0 + n3z0) – (n1a + n2b + n3c) P'(x', y', z')


C
= d0 – d1

z
Generalized Projection

• Follow the steps –


– Translate so that C lies at the origin
– Per
– Translate back

 d + an1 an2 an3 − ad 0 


 
 bn1 d + bn2 bn3 − bd 0 
 cn cn2 d + cn3 − cd 0 
 1

 n − d1 
 1 n2 n3
Generalized Projection
• Find (a) the vanishing points for a given perspective
transformation in the direction given by a vector U (b)
principal vanishing point.

• Family of parallel lines having the direction U(u1,u2,u3) can be


written in parametric form as
– x = u1t+p, y = u2t+q, z = u3t+r
– here (p, q, r) is any point on the line

• Let, proj(x,y,z,1) = (x‘, y‘, z‘, h)


– x' = (d+an1)(u1t+p) + an2(u2t+q) + an3(u3t+r) – ad0
– y' = bn1(u1t+p) + (d+bn2)(u2t+q) + bn3(u3t+r) – bd0
– z' = cn1(u1t+p) + cn2(u2t+q) + (d+cn3)(u3t+r) – cd0
– h = n1(u1t+p) + n2(u2t+q) + n3(u3t+r) – d1
Generalized Projection
• The vanishing point (xv, yv, zv) is obtained when t=α
– xu = (x‘/h) at t= α
= a + (du1/k)
– yu = b + (du2/k)
– zu = c + (du3/k)
– k = N.U = n1u1 + n2u2 + n3u3

• If k=0 then ?
• Principal vanishing point when
– U=I
• xu = a + d / n1, yu = b, zu = c,
– U=J
– U=k
Ref.

• Foley V.: p. 229-237, 253-258


• Schaum’s: problem numbers 7.1 – 7.15

You might also like