0% found this document useful (0 votes)
553 views60 pages

Projection-Computer Graphics

The document discusses different types of geometric projections, including perspective, parallel, and planar projections. Perspective projection models the human visual system, with object size varying inversely with distance from the center of projection. Parallel projection preserves angles and distances. Planar projections are onto a plane rather than a curved surface, with straight projectors emanating from the center of projection.

Uploaded by

Gopal Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
0% found this document useful (0 votes)
553 views60 pages

Projection-Computer Graphics

The document discusses different types of geometric projections, including perspective, parallel, and planar projections. Perspective projection models the human visual system, with object size varying inversely with distance from the center of projection. Parallel projection preserves angles and distances. Planar projections are onto a plane rather than a curved surface, with straight projectors emanating from the center of projection.

Uploaded by

Gopal Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 60

Projection

Projection
Projection
Conceptual model of 3D viewing process
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.
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
B
A'
B'
Center of
projection
Projectors
Projection
plane
Perspective projection
A
B
A'
B'
Center of
projection
at infinity
Projectors
Projection
plane
Direction
of
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.
Parallel:
less realistic view because of no
foreshortening
however, parallel lines remain
parallel.
angles only remain intact for faces
parallel to projection plane.

Perspective v Parallel
Perspective projection- anomalies
Perspective foreshortening The farther an object is
from COP the smaller it appears
A
B A'
B'
Center of
projection
Projectors
Projection
plane
C
D
C'
D'
Perspective foreshortening
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
x
y
z
z-axis vanishing point
Vanishing point
Perspective projection- anomalies
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.

P
1
P
3
P'
3
C
Y
X
Z
P
2
P'
1
P'
2
View Plane
Plane containing
Center of Projection (C)
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
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
Vanishing Point
VPL
VPR
H
VP
1

VP
2

VP
3

Projective Transformation
y
x
z
view direction
center of
projection
plane of
projection
d
Settings for perspective projection
y
P(y,z)
y
z
P'(y
p
,z
p
)
d
-z
plane of
projection
( )
( )
( ) ( )
|
|
.
|

\
|

=

= =

1 , , , 1 , , , d
d z
y
d z
x
z y x
d z
d z
y
y
d
y
z
y
p
p
Projective Transformation
( )
( )
|
|
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
.
|

\
|
|
|
|
|
|
.
|

\
|
1
/
/
1 ? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
d
d z
y
d z
x
z
y
x
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
.
|

\
|
|
|
|
|
|
.
|

\
|
d
z
z
y
x
z
y
x
1 ? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
.
|

\
|
|
|
|
|
|
.
|

\
|

d
z
z
y
x
z
y
x
d
1
0
1
0 0
0 1 0 0
0 0 1 0
0 0 0 1
( )
( )
|
|
|
|
|
|
|
.
|

\
|


|
|
|
|
|
.
|

\
|

1

d
d z
y
d z
x
d
z
z
y
x
division
e perspectiv
Projective Transformation
Parallel projection
2 principle types:
orthographic and
oblique.

Orthographic :
direction of projection =
normal to the projection
plane.

Oblique :
direction of projection !=
normal to the projection
plane.

n
n
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
Orthographic projection
Orthogonal Projection Matrix
|
|
|
|
|
.
|

\
|
=
|
|
|
|
|
.
|

\
|
|
|
|
|
|
.
|

\
|
1
0
1 1 0 0 0
0 0 0 0
0 0 1 0
0 0 0 1
y
x
z
y
x
y
x
z
view direction
plane of
projection
direction of
projection
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.
y
z
x
Projection Plane
Isometric proj
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
n
Projection Plane Normal
Projector
Projection Plane
x
y
z

Cavalier:
The direction of the projection makes a 45 degree
angle with the projection plane.
There is no foreshortening
Oblique parallel projection
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/



P=(0, 0, 1)
P( cos(), sin(),0)
cos()
sin()

Oblique parallel projection
=1 | = 45 Cavalier projection o = 0 - 360
=0.5

| = 63.4

Cabinet projection o = 0 360
=0

| = 90

Orthogonal projection o = 0 360
Oblique parallel projection
PP = ( cos(), sin(),-1) = DOP
Proj(P) = ( cos(), sin(),0)

Generally
multiply by z and allow for (non-zero) x and y
x = x + z cos o
y = y + z sin o


|
|
|
|
|
.
|

\
|
|
|
|
|
|
.
|

\
|
=
|
|
|
|
|
.
|

\
|
'
'
1
.
1 0 0 0
0 0 0 0
0 sin 1 0
0 cos 0 1
1
0 z
y
x
y
x
o
o
x
y
o
) , ( y x

) , (
p p
y x
o
o
sin
cos
+ =
+ =
y y
x x
p
p
Generalized Projection Matrix
x or y
Center of Projection
(COP)
z
P = (x, y, z)
P
p
= (x
p
, y
p
, z
p
)
(d
x
, d
y
, d
z
)
(0, 0, z
p
)
Q
Plane of Projection
( )
( ) ( )
z y x p
p
d d d Q z COP
t COP P t COP P
, , , 0 , 0
1 0 ,
+ =
s s + =
( )
( )
( )
( ) ( ) ( )
z p z p
y y
x x
Qd z z t Qd z z
Qd y t Qd y
Qd x t Qd x
z y x P
+ + + = '
+ = '
+ = '
' ' ' = ' , ,
Generalized Projection Matrix
( ) ( ) ( )
( )
( )
z p
z p p
z p z p p
Qd z z
Qd z z
t
Qd z z t Qd z z
+
+
=
+ + + =
1 1
1
1
1
2
+

+
+
=
+

=
+

+
=
+

+
=
z
p
z
z p p
z
p
z
p
z
p
p p
z
p
z
y
p
z
y
p
z
p
z
x
p
z
x
p
Qd
z z
Qd
Qd z z
Qd
z
z
Qd
z z
Qd
z z
z z
Qd
z z
d
d
z
d
d
z y
y
Qd
z z
d
d
z
d
d
z x
x
Generalized Projection Matrix
|
|
|
|
|
|
|
|
|
|
|
.
|

\
|
+
+

=
1
1
0 0
0 0
1 0
0 1
2
z
p
z
p
z
p
z
p
z
y
p
z
y
z
x
p
z
x
gen
Qd
z
Qd
z
Qd
z
Qd
z
d
d
z
d
d
d
d
z
d
d
M
1
1
1
2
+

+ +
=
+

+
=
+

+
=
z
p
p
z
p
z
p
p
z
p
z
y
p
z
y
p
z
p
z
x
p
z
x
p
Qd
z z
z
Qd
z
Qd
z
z
z
Qd
z z
d
d
z
d
d
z y
y
Qd
z z
d
d
z
d
d
z x
x
Generalized Projection Matrix
|
|
|
|
|
.
|

\
|

=
= = =
= =
0
1
0 0
0 1 0 0
0 0 1 0
0 0 0 1
1 , 0 , 0
, ,
d
M
per
d d d
d Q d z
z y x
p

|
|
|
|
|
|
|
|
|
|
.
|

\
|
+
+

=
1
1
0 0
0 0
1 0
0 1
2
z
p
z
p
z
p
z
p
z
y
p
z
y
z
x
p
z
x
gen
Qd
z
Qd
z
Qd
z
Qd
z
d
d
z
d
d
d
d
z
d
d
M
Generalized Projection Matrix
|
|
|
|
|
.
|

\
|
=
= = =
= =
1 0 0 0
0 0 0 0
0 0 1 0
0 0 0 1
1 , 0 , 0
, , 0
par
d d d
Q z
M
z y x
p

|
|
|
|
|
|
|
|
|
|
.
|

\
|
+
+

=
1
1
0 0
0 0
1 0
0 1
2
z
p
z
p
z
p
z
p
z
y
p
z
y
z
x
p
z
x
gen
Qd
z
Qd
z
Qd
z
Qd
z
d
d
z
d
d
d
d
z
d
d
M
Taxonomy of Projection
OpenGLs Perspective Specification
w
h
u
y
x
z
near
far
aspect = w / h
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
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
.
|

\
|
|
|
|
|
|
.
|

\
|

d
z
z
y
x
z
y
x
d
1
0
1
0 0
0 1 0 0
0 0 1 0
0 0 0 1
( )
( )
|
|
|
|
|
|
|
.
|

\
|


|
|
|
|
|
.
|

\
|

1
d
d z
y
d z
x
d
z
z
y
x
division
e perspectiv

The depth information is
lost as the last two
components are same
But dept information of the
projected points is essential
for hidden surface removal
and other purposes like
blending, shading etc.
Perspective without Depth
( )
( )
( )
|
|
|
|
|
|
|
|
.
|

\
|
+


|
|
|
|
|
|
.
|

\
|

+
=
|
|
|
|
|
.
|

\
|
|
|
|
|
|
|
.
|

\
|

1
1
0
1
0 0
0 0
0 0 1 0
0 0 0 1
z
z d
d z
y
d z
x
d
z
z
y
x
z
y
x
d
division
e perspectiv
| o
| o | o
z
d
d z
|
o

=
'
For < 0, z is a monotonically increasing function of depth.
Canonical View Volume
x
y
z
(-1,1,1)
(-1,-1,1)
(-1,1,-1)
(1,1,-1)
(1,-1,-1)
(-1,-1,-1)
(1,-1,1)
(1,1,1)
far near
1 1
1 1
1 1
s s
s s
s s
z
y
x
Canonical View Volume
There is a reversal of the z- coordinates, in the sense that before
the transformation, points further from the viewer have smaller z-
coordinates
y
z
z=-far
z=-near
+1
-1
+1 -1
y
z
viewer
z=-1 (near) z=1 (far)
Perspective Matrix
The matrix to perform perspective transformation:
|
|
|
|
|
.
|

\
|
+


=
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
.
|

\
|

|
|
|
|
|
.
|

\
|

1
) /( ) (
) /(
) /(
1 0 1 0 0
0 0
0 0 0
0 0 0
z z
z y
z x
z
z
y
x
z
y
x
| o
o

| o
o

| o
o

Perspective Matrix
w
h
/2
y
x
z
a = w / h
z = -near
z = -far
( )
|
.
|

\
|

= = = =
=

=
|
.
|

\
|
=
z
c
z
c
az
z y x
c
az
y a x
y
x
h
w
a
c
z
y
y
z
c
, , , ,
2
cot
u
Perspective Matrix
( )
( )
( )
( ) 1 , 1 , 1 , ,
1 , 1 , 1 , ,
1 , 1 , 1 , ,
1 , 1 , 1 , ,

|
.
|

\
|


|
.
|

\
|


|
.
|

\
|


|
.
|

\
|

n
c
n
c
an
n
c
n
c
an
n
c
n
c
an
n
c
n
c
an
( )
( )
( )
( ) 1 , 1 , 1 , ,
1 , 1 , 1 , ,
1 , 1 , 1 , ,
1 , 1 , 1 , ,

|
.
|

\
|


|
.
|

\
|


|
.
|

\
|


|
.
|

\
|

f
c
f
c
af
f
c
f
c
af
f
c
f
c
af
f
c
f
c
af
w
h
/2
y
x
z
a = w / h
z = -near
z = -far
Perspective Matrix
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
|
.
|

\
|
+

1
1
1
1
n
n
c
n
c
an
| o
o

n n
c
a
c
= +
=
=
| o
o

( )
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
|
.
|

\
|

|
|
|
|
|
.
|

\
|


|
.
|

\
|

1
1
1
1
1
0 1 0 0
0 0
0 0 0
0 0 0
1 , 1 , 1 , ,
n
c
n
c
an
n
c
n
c
an
| o
o

|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
|
|
.
|

\
|
+

1
1
1
1
1
n
n
c
c
a
| o
o

Perspective Matrix
( )
|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
|
.
|

\
|

|
|
|
|
|
.
|

\
|


|
.
|

\
|

1
1
1
1
1
0 1 0 0
0 0
0 0 0
0 0 0
1 , 1 , 1 , ,
f
c
f
c
af
f
c
f
c
af
| o
o

|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
|
|
|
.
|

\
|
+

1
1
1
1
1
f
f
c
c
a
| o
o

|
|
|
|
|
.
|

\
|

=
|
|
|
|
|
|
.
|

\
|
+

1
1
1
1
f
f
c
f
c
af
| o
o

f n
f n
f n
n f
n n
f f

+
=
= +
= +
2
|
o
| o
| o

Perspective Matrix
The matrix to perform perspective transformation:
|
|
|
|
|
|
.
|

\
|


+
0 1 0 0
2
0 0
0 0 0
0 0 0
f n
f n
f n
n f
c
a
c
Taxonomy of projection
Generalized Projection
Using the origin as the center of projection, derive the perspective
transformation onto the plane passing through the point R
0
(x
0
, y
0
, z
0
)
and having the normal vector N = n
1
I + n
2
J + n
3
K.

x
y
z
P(x, y, z)
P'(x', y', z')
N = n
1
I + n
2
J + n
3
K
R
0
=x
0
,y
0
, z
0

O
Generalized Projection
z n y n x n
d
3 2 1
0
+ +
= o
x
y
z
P(x, y, z)
P'(x', y', z')
N = n
1
I + n
2
J + n
3
K
R
0
=x
0
,y
0
, z
0

O
P'O = PO
x' = x, y' = y, z ' = z
N. R
0
P' = 0
n
1
x ' + n
2
y ' + n
3
z '
=n
1
x
0
+ n
2
y
0
+ n
3
z
0
= d
0

|
|
|
|
|
.
|

\
|
=
0
0 0 0
0 0 0
0 0 0
3 2 1
0
0
0
n n n
d
d
d
Per
Generalized Projection
Derive the general perspective transformation onto a plane with reference
point R
0
and normal vector N and using C(a,b,c) as the center of projection.
x
y
z
P(x, y, z)
P'(x', y', z')
N = n
1
I + n
2
J + n
3
K
R
0
=x
0
,y
0
, z
0

C
Generalized Projection
) ( ) ( ) (
3 2 1
c z n b y n a x n
d
+ +
= o
P'C = PC
x' = (x-a) + a
n
1
x' + n
2
y' + n
3
z = d
0
d = (n
1
x
0
+ n
2
y
0
+ n
3
z
0
) (n
1
a + n
2
b + n
3
c)
= d
0
d
1

x
y
z
P(x, y, z)
P'(x', y', z')
N = n
1
I + n
2
J + n
3
K
R
0
=x
0
,y
0
, z
0

C
Generalized Projection
Follow the steps
Translate so that C lies at the origin
Per
Translate back
|
|
|
|
|
.
|

\
|

+
+
+
1 3 2 1
0 3 2 1
0 3 2 1
0 3 2 1
d n n n
cd cn d cn cn
bd bn bn d bn
ad an an an d
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(u
1
,u
2
,u
3
)
can be written in parametric form as
x = u
1
t+p, y = u
2
t+q, z = u
3
t+r
here (p, q, r) is any point on the line

Let, proj(x,y,z,1) = (x, y, z, h)
x' = (d+an
1
)(u
1
t+p) + an
2
(u
2
t+q) + an
3
(u
3
t+r) ad
0
y' = bn
1
(u
1
t+p) + (d+bn
2
)(u
2
t+q) + bn
3
(u
3
t+r) bd
0
z' = cn
1
(u
1
t+p) + cn
2
(u
2
t+q) + (d+cn
3
)(u
3
t+r) cd
0
h = n
1
(u
1
t+p) + n
2
(u
2
t+q) + n
3
(u
3
t+r) d
1




Generalized Projection
The vanishing point (x
v
,

y
v
, z
v
) is obtained when t=
x
u
= (x/h) at t=
= a + (du
1
/k)
y
u
= b + (du
2
/k)
z
u
= c + (du
3
/k)
k = N.U = n
1
u
1
+ n
2
u
2
+ n
3
u
3

If k=0 then ?
Principal vanishing point when
U = I
x
u
= a + d / n
1
, y
u
= b, z
u
= c
,

U = J
U = k
Ref.
FV: p. 229-237, 253-258
Sch: prob. 7.1 7.15
Perspective Proj.pdf

You might also like