You are on page 1of 30

PE-III : Computer Graphics

Unit – II: Projections in Computer Graphics


(AY 2020-21 Tri.IX)
• Prepared By:

Prof. S. S. Pachpore
Assistant Professor in
School of Mechanical Engineering, MITWPU
CONTENT OF THE UNIT

• Orthographic Projection
• Isometric Projection
• Perspective Projection
• Transformation for Orthographic Projection
• Transformation for Isometric Projection
• Programming basis for the projection methods

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 2
Computer Graphics (PE-III)
Projections:-
• Importance of Projection?
• In Graphics, 3D object is represented on plane paper.
• Similarly, in CG 3D object is viewed on 2D display and PROJECTION is a
transformation which does that.

• Terminology used in Projections


1. Center of Projection:
View point from where all projection rays starts
2. Projector:
Projection rays used for obtaining the projection of an object
3. Projection plane:
Plane on which a 2D image of an object is obtained

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 3
Computer Graphics (PE-III)
(a) (b)

Fig:- Projection Terminologies

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 4
Computer Graphics (PE-III)
 Types of Projections:

Based on entre of
Projection and projector
the projections are broadly
classified in to
1. Parallel Projection
2. Perspective
Projection

Fig:- Types of Projections

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 5
Computer Graphics (PE-III)
 Concept of Parallel Projections:

If the Centre of Projection is at infinite


distance from the projection plane, all
the projector are parallel to each other,
called as Parallel Projections.

It preserves actual dimensions of the


object.

This method is used to in drafting i.e. to


produce front, top and side view of an
object. Fig:- Parallel Projections

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 6
Computer Graphics (PE-III)
 Concept of Perspective Projections:

If the Centre of Projection is at infinite


distance from the projection plane, and
all the projector are non-parallel and
meet at the center of projection to each
other, called as Perspective Projections.

It may not preserves actual dimensions of


the object.

This method helps in adding an artistic


Fig:- Perspective Projections
effect and enhancing realism to projected
view.
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 7
Computer Graphics (PE-III)
 Concept of Vanishing Point:
• Under perspective projections, any set
of parallel lines that are not parallel to
the PP will converge to a vanishing
Fig:- Vanishing Point
point.
• Vanishing points of lines parallel to a
principal axis x, y, or z are called
principal vanishing points.

• How many of these can there be?


Fig:- Types of Vanishing Point
• One-point perspective — simplest to draw
• Two-point perspective — gives better impression of depth
• Three-point perspective — most difficult to draw

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 8
Computer Graphics (PE-III)
ONE/TWO point Perspective Projection.

(a) One Point Perspective Projection (a) Two Point Perspective Projection

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 9
Computer Graphics (PE-III)
Examples of Perspective Projection.

(b) Two Point Perspective Projection

(a) One Point Perspective Projection


https://www.youtube.com/wa
1 Point tch?time_continue=404&v=Vo
3CEtzIORg&feature=emb_title

https://www.youtube.com/w
2 Point
atch?v=rCanYY7eLeA

https://www.youtube.com/
3 Point watch?v=Bdgt9YHUTmg
(c) Three Point Perspective Projection
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 10
Computer Graphics (PE-III)
Parallel Projections:

Orthographic Projections: Axonometric Projections:

 Concept of Orthographic Projections:


• All the projectors are parallel to each
other and perpendicular to Projector
Plane.
• One of the principal axes on MCS
(Model coordinate System) in
perpendicular and remaining two are
parallel to Projector Plane.
Fig:- Orthographic Projection
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 11
Computer Graphics (PE-III)
 Concept of Axonometric Projections:

• All the projectors are parallel to each


other and inclined to Projector Plane.
• Principal axes on MCS (Model
coordinate System) in inclined to
Fig:- Axonometric Projection
Projector Plane.
• On can see several faces of the model
at one glance.
• Common Axonometric Projection is
Isometric Projection

Fig:- Orthographic Projection


MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 12
Computer Graphics (PE-III)
 Concept of Isometric Projections:

Fig:- Isometric Projection

Projection plane intersects the each principal axis of the MCS of the object at
the same distance form the origin.
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 13
Computer Graphics (PE-III)
Transformation for Projection

Orthographic Projections: Isometric Projections:

Theory / Derivation (6-8 Mks)


Numerical (8-10 Mks)

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 14
Computer Graphics (PE-III)
1 0 0 0
0 1 0
0 0 1 0
0 0 0 1
To get in XY plane only

For FV, Z=0 and view should be in 1st quadrant OF= O

For TV, Y=0 then the view will be XZ plane, rotate @ x axis in CCW ------- OT = Rx * O

For RHSV, X=0 then the view will be in YZ plane, rotate @ y axis in CW------ORS= Ry *O

For LHSV, X=0 then the view will be in YZ plane, rotate @ y axis in CCW
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 15
Computer Graphics (PE-III)
 Transformation for Orthographic Projection:
• Orthographic Projection: Based on parallel
Projection system and is obtained by setting
to zero the coordinate along which the view
is being generated.
• Views to be generated ion 2D plane only
commonly known as viewing or display
plane.
• Assume that, coordinates of viewing plane in
Xv and Yv because generally, by default, XY
Fig:- Orthographic Projection
plane is considered as viewing plane.
• For FV (Xv Yv ) will get mapped automatically
with (X Y) of MCS; for other views mapping is
necessary. MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 16
Computer Graphics (PE-III)
 Transformation for Orthographic Projection (FV):

• FV can be obtained easily by setting


z=0 for all points on the model.
• We always use 3D homogeneous
coordinate system for plotting the
transformation.
Fig:- FV of Orthographic Projection
𝑥
𝑦
• The coordinate of any point P on the solid model in MCS is 𝑃 = 𝑧
1
• Thus the coordinates of point P in FV is given by
Instead of 1 here it
𝑥𝑓 𝑥 will be 0 as z=0 and
1 0 0 0
𝑦𝑓 𝑦 we are working in
= 01 0 0
𝑧 XY plane.
0 0 0 0 0
1 0 0 0 1 1
Transformation
matrix for FV.
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 17
Computer Graphics (PE-III)
 Transformation for Orthographic Projection (TV):
• TV can be obtained easily by setting y=0 for all
points on the model.
• Here we are considering XY plane for
transformation and Y=0, thus in viewing
coordinate system Yt= -Z.
Fig:- TV of Orthographic Projection
• The coordinate of any point P on the solid

𝑥 This transformation matrix is obtained through


𝑦 OTV = Rx900 * Object Matrix
model in MCS is 𝑃 = 𝑧
1 0 0 0 1 0 0 0
1 = 0 cos (90) -sin (90) 0
* 0 0 0 0
0 sin(90) cos(90) 0 0 0 1 0
0 0 0 1 0 0 0 1

𝑥𝑡 1 0 0 0 𝑥
𝑦𝑡 0 0 -1 0 𝑦
• = * 𝑧
0 0 0 0 0
0 0 0 1
1 1 Transformation matrix for TV.
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 18
Computer Graphics (PE-III)
 Transformation for Orthographic Projection (RHSV):
• RHSV can be obtained in YZ plane, the X coordinate must be =0.
0 0 0 0
0 1 0 0
• Thus the matrix becomes 0 0 1 0
0 0 0 1

• In order to obtained coordinates in XY plane the view need to be rotated by 900


in Y direction in clockwise direction; thus  = - 900.

This transformation matrix is obtained through


ORHSV = RY -900 * Object Matrix
cos (-90) 0 sin(-90) 0 0 0 0 0
0 1 0 0 0 1 0 0
= *
𝑥
-sin(-90) 0 cos(90) 0 0 0 1 0

𝑥 0 0 0 1 0 0 0 1

𝑦 0 0 -1 0
• Therefore, 𝑧 = 0 1 0 0 * 𝑦
0 0 0 0 𝑧
1 0 0 0 1 1
Transformation matrix for RHSV.

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 19
Computer Graphics (PE-III)
 List of Transformation Matrices in Orthographic Projection:

1 0 0 0
Transformation 0 1 0 0
matrix for FV.
0 0 0 0
0 0 0 1 0 0 -1 0
Transformation 0 1 0 0
matrix for RHSV. 0 0 0 0
0 0 0 1
1 0 0 0
Transformation 0 0 -1 0
matrix for TV.
0 0 0 0
0 0 0 1

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 20
Computer Graphics (PE-III)
 Problems Orthographic Projection:
Pb.1 A triangular prism is shown in fig. With the transformation matrix, generate
the data for the orthographic views of the object in viewing plane. The
coordinates of the vertices are A (2,3,4), B (5,3,4), C (2,5,4), D(2,3,10), E (5,3,10)
and F (2,5,10). Plot the results obtained.

Solution: Here note that viewing plane means XY plane.


Step 1: Writing the coordinates of given object in matrix form i.e.
Homogenous coordinate system. A B C D E F
X 2 5 2 2 5 2
V= Y 3 3 5 3 3 5
Z 4 4 4 10 10 10
h 1 1 1 1 1 1

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 21
Computer Graphics (PE-III)
Step 2: Obtaining coordinates in FV 1 0 0 0
0 1 0 0
The transformation matrix in viewing plane i.e. in XY plane is given as, 0 0 0 0
0 0 0 1
Thus the new coordinates can be obtained by VF = [T]*V

1 0 0 0 A B C D E F
X 2 5 2 2 5 2 2 5 2 2 5 2 New Coordinates in
0 1 0 0 3 3 5 3 3 5
V F= * Y 3 3 5 3 3 5 = FV.
0 0 0 0 Z 4 4 4 10 10 10 0 0 0 0 0 0
0 0 0 1 h 1 1 1 1 1 1 1 1 1 1 1 1

Step 3: Obtaining coordinates in TV 1 0 0 0


0 0 -1 0
The transformation matrix in viewing plane i.e. in XY plane is given as,
0 0 0 0
Thus the new coordinates can be obtained by VT = [T]*V 0 0 0 1

1 0 0 0 A B C D E F
X 2 5 2 2 5 2 2 5 2 2 5 2
VT =
0 0 -1 0
* Y 3 3 5 3 3 5 = -4 -4 -4 -10 -10 -10 New Coordinates in
0 0 0 0 Z 4 4 4 10 10 10 0 0 0 0 0 0 TV.
1 1 1 1 1 1
0 0 0 1 h 1 1 1 1 1 1

25 April 2022 MITWPU, PUNE: TY BTECH (MECH ENGG) 22


Computer Graphics (PE-III)
Step 4: Obtaining coordinates in RHSV 0 0 -1 0
0 1 0 0
The transformation matrix in viewing plane i.e. in XY plane is given as, 0 0 0 0
Thus the new coordinates can be obtained by VR = [T]*V 0 0 0 1

0 0 -1 0 A B C D E F
-4 -4 -4 -10 -10 -10
X 2 5 2 2 5 2
VR = 0 1 0 0 *
Y 3 3 5 3 3 5
= 3 3 5 3 3 5 New Coordinates in
0 0 0 0 Z 4 4 4 10 10 10
0 0 0 0 0 0 RHSV.
1 1 1 1 1 1
0 0 0 1 h 1 1 1 1 1 1

Step 5: Plotting the Views

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 23
Computer Graphics (PE-III)
Pb.2 A triangle has coordinates A(1,2,3), B(4,3,4), C(5,8,2). The three
orthographic views of this triangle are to be projected. Write the transformation
matrix and determine coordinates and plot the views.

Solution: Here note that viewing plane means XY plane.


Step 1: Writing the coordinates of given object in matrix form i.e. Homogenous
coordinate system. A B C
X 1 4 5
Δ ABC = Y 2 3 8
Z 3 4 2
h 1 1 1
Step 2: Obtaining coordinates in FV 1 0 0 0
0 1 0 0
The transformation matrix in viewing plane i.e. in XY plane is given as, 0 0 0 0
0 0 0 1

Thus the new coordinates can be obtained by Δ ABC F = [T]* Δ ABC

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 24
Computer Graphics (PE-III)
1 0 0 0 A B C
X 1 4 5 1 4 5
0 1 0 0
Δ ABC F = * Y 2 3 8 = 2 3 8
0 0 0 0 0 0 0
Z 3 4 2
0 0 0 1 h 1 1 1 1 1 1

Step 3: Obtaining coordinates in TV Step 5: Plotting the Views


1 4 5
Δ ABC T = -3 -4 -2
0 0 0
1 1 1
Step 4: Obtaining coordinates in RHSV
-3 -4 -2
Δ ABC RSV= 2 3 8
0 0 0
1 1 1

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 25
Computer Graphics (PE-III)
Pb.3 A tetrahedron is defined by the following points A(2,3,4), B(6,3,4), C(2,5,4),
D(4,4,10). Obtain a transformation matrix to generate data for the orthographic
view of the object in viewing plane. A B C D
X 2 6 2 4
Step 1: Coordinates in FV Co-ord. of Tetrahedron in Matrix Form Y 3 3 5 4
2 6 2 4 Z 4 4 4 10
3 3 5 4 h 1 1 1 1
0 0 0 0
1 1 1 1

Step 2: Coordinates in TV 2 6 2 4
-4 -4 -4 -10
0 0 0 0
1 1 1 1

-4 -4 -4 -10
Step 3: Coordinates in RHSV 3 3 5 4
0 0 0 0
1 1 1 1
MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 26
Computer Graphics (PE-III)
 Transformation for Isometric Projection:
• All the projectors are not parallel Projector Plane.
• This preserves the parallelism of the lines but not the angles.
• In this, all three principal axes are equally reduced.

• In this, the normal projection planes make


equal angle with each principal axis and axes
are equispaced at an angle of 1200.

Fig:- Isometric Projection

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 24
Computer Graphics (PE-III)
• To obtain most common orientation in the viewing plane (i.e. XY plane and
Z=0), consider an example of cube;
• This is done by first looking straight towards one face. Next, the cube is rotated
-45° about the vertical axis, followed by a rotation of approximately 35.264°
about the horizontal axis.
Thus,{Pi} = Object matrix (Z=0) *[Rx] * [Ry] *{P}

Transformation
matrix for Isometric
Projection
Now,

1 0 0 0 cos  0 sin  0
0 cos ᴓ -sin ᴓ 0
[Rx] = 0 sin ᴓ cos ᴓ 0
and [Ry] = 0 1 0 0
- sin  0 cos  0
0 0 0 1 0 0 0 1
Note: Here anticlkwise rotation assumed for Rx and Ry, thus the
Fig:- Viewing plane angles of angles are considered to be positive.
Isometric Projection MITWPU, PUNE: TY BTECH (MECH ENGG)
25 April 2022 28
Computer Graphics (PE-III)
1 0 0 0 1 0 0 0 cos  0 sin  0 0.7070 0 -0.7070 0
Thus,[T]= Oz*[Rx]*[Ry]= 0 1 0 0 * 0 cos ᴓ -sin ᴓ 0 * 0 1 0 0 = -0.408 0.817 -0.408 0
0 0 0 0 0 sin ᴓ cos ᴓ 0 - sin  0 cos  0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1

Transformation
matrix for Isometric
Projection

Pb.4 Write down the transformation matrix for generating an isometric view. Generate the
data for the isometric view of the object in the viewing plane for a triangular prism with
vertices A(20,30,40), B (50,30,40), C (20,50,40), D(20,30,100), E(50,30,100) and F
(20,50,100). Plot the results obtained.
Solution: Here note that viewing plane means XY plane.
Step 1: Writing the coordinates of given object in matrix form i.e.
Homogenous coordinate system. A B C D E F
X 20 50 20 20 50 20
V= Y 30 30 50 30 30 50
Z 40 40 40 100 100 100
h 1 1 1 1 1 1

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 29
Computer Graphics (PE-III)
Step 2: Obtaining transformation matrix in ISO
0.7070 0 -0.7070 0
The transformation matrix in viewing plane i.e. in XY plane is given as, -0.408 0.817 -0.408 0
0 0 0 0
0 0 0 1

Hence the coordinate of new geometry are Viso=Iso * V


0.7070 0 -0.7070 0
-0.408 0.817 -0.408 0
i.e. Viso = * =
0 0 0 0
0 0 0 1

-14.14 7.07 -14.14 -56.56 -35.35 -56.56


0.03 -12.21 16.37 -24.45 -36.69 -8.11
0 0 0 0 0 0
1 1 1 1 1 1

MITWPU, PUNE: TY BTECH (MECH ENGG)


25 April 2022 30
Computer Graphics (PE-III)

You might also like