SlideShare a Scribd company logo
2
Most read
6
Most read
8
Most read
SBE 306: Computer Graphics
Projection
Dr. Ayman Eldeib
Systems & Biomedical
Engineering Department
Spring 2019
Computer Graphics Projection
Types of Projections
Perspective
Projection
Parallel
Projection
“Orthographic ”
Computer Graphics Projection
Simple Orthographic Projection
 Project all points along the z axis to the z= 0 plane





































11000
0000
0010
0001
1
0
'
'
z
y
x
y
x
Computer Graphics Projection
Perspective Transformations
 Perspective transformations do not preserve parallelism,
i.e. Parallel lines not parallel; converge to single point
 Further objects are smaller (size, inverse distance)
B
A’
B’
Center of projection
(camera/eye location)
A
Computer Graphics Projection
Perspective Projection
 In the real world, objects exhibit perspective
foreshortening: distant objects appear smaller.
 The basic situation:
Computer Graphics Projection
 When we do 3-D graphics, we think of the screen as a 2-D
window onto the 3-D world
How tall
should
this bunny
be?
Cont.
Perspective Projection
Computer Graphics Projection
 The geometry of the situation is that of similar triangles.
View from above:
P (x, y, z)X
-Z
View
plane
d
(0,0,0) x’ = ?
 What is x’ ?
Cont.
Perspective Projection
Computer Graphics Projection
P (x, y, z)X
-Z
View
plane
d
(0,0,0) x’ = ?
z
y
d
y
z
x
d
x

'
,
'
dz
dz
y
z
yd
y
dz
x
z
xd
x 



 ',','
Cont.
Perspective Projection
Computer Graphics Projection
A Perspective Projection Matrix
z
y
d
y
z
x
d
x

'
,
'
dz
dz
y
z
yd
y
dz
x
z
xd
x 



 ',','















d
z
z
y
x
































1
1
'
'
'
d
z
yd
z
xd
z
y
x


























 10
1
00
0100
0010
0001
z
y
x
d
Perspective Matrix
Computer Graphics Projection
Example














0100
0100
0010
0001
d
M eperspectiv






































 dz
z
y
x
z
y
x
d 10100
0100
0010
0001
Cont.
A Perspective Projection Matrix
Computer Graphics Projection
P (x, y, z)X
-Z
View
plane
d
(0,0,0) x’ = ?














0100
0100
0010
0001
d
M eperspectiv
 View plane is at –d on z coordinate
 (Only) last row affected (no longer 0 0 0 1)
Cont.
A Perspective Projection Matrix
Computer Graphics Projection
 Now that we can express perspective
foreshortening as a matrix, we can composite it
onto our other matrices with the usual matrix
multiplication
 End result: can create a single matrix
encapsulating modeling, viewing, and projection
transforms
Though you recall that in practice OpenGL
separates the modelview from projection
matrix (why?)
Cont.
A Perspective Projection Matrix
Computer Graphics Projection
Defining a Viewing Region
 Most graphics API’s use two methods for defining a
viewing region
 The viewing frustum
In OpenGL glFrustum (xmin,xmax,ymin,ymax,near,far)
 The screen projection plane
This is a special case of the viewing frustum
Also called the symmetric perspective projection frustum
In OpenGL gluPerspective (theta,aspect,near,far)
Computer Graphics Projection
Viewing Frustum
 void glFrustum( GLdouble left,
GLdouble right, GLdouble
bottom, GLdouble top, GLdouble
near, GLdouble far )
 Parameters:
 left, right: Specify the
coordinates for the left and
right vertical clipping planes;
 bottom, top: Specify the
coordinates for the bottom
and top horizontal clipping
planes;
 near, far: Specify the
distances to the near and far
depth clipping planes. Both
distances must be positive.
Computer Graphics Projection
 void gluPerspective( GLdouble fovy,
GLdouble aspect, GLdouble zNear,
GLdouble zFar )
 Parameters:
 Fovy: Specifies the field of view
angle, in degrees, in the y
direction;
 Aspect: Specifies the aspect ratio
that determines the field of view in
the x direction. The aspect ratio is
the ratio of x (width) to y (height);
 ZNear: Specifies the distance from
the viewer to the near clipping
plane (always positive);
 ZFar: Specifies the distance from
the viewer to the far clipping plane
(always positive)
Cont.
Viewing Frustum
Computer Graphics Projection
 The viewing frustum defines a region of 3D space
assuming that the eye is located at (0, 0, 0).
 A 4x4 perspective transformation maps the
viewing frustum to a canonical cube
 Once a canonical cube is obtained 3D points are
projected to 2D by dropping the z component
 Note perspective projection is obtained by using
a perspective transformation followed by
orthographic projection
Cont.
Viewing Frustum
Computer Graphics Projection
 OpenGL’s gluPerspective() command generates a
slightly more complicated matrix:














































2
cotwhere
0100
2
00
000
000
y
farnear
nearfar
farnear
nearfar
fov
f
ZZ
ZZ
ZZ
ZΖ
f
aspect
f
Cont.
Viewing Frustum
Thank You

More Related Content

PPT
Hidden lines & surfaces
PPTX
2d-transformation
PPT
3 d geometric transformations
PPTX
3d transformation computer graphics
PPT
Polygon clipping
PPTX
Computer Graphics: Visible surface detection methods
PPTX
Window to viewport transformation&matrix representation of homogeneous co...
PPT
3 d viewing
Hidden lines & surfaces
2d-transformation
3 d geometric transformations
3d transformation computer graphics
Polygon clipping
Computer Graphics: Visible surface detection methods
Window to viewport transformation&matrix representation of homogeneous co...
3 d viewing

What's hot (20)

PPTX
3 d display methods
PPT
Shading
PPT
Window to viewport transformation
PPTX
2D viewing & clipping
PPT
Quadric surfaces
PPTX
Projection In Computer Graphics
PPTX
Clipping computer graphics
PPTX
3D transformation in computer graphics
PPTX
Projections.pptx
PDF
3D Transformation
PDF
Computer graphics - colour crt and flat-panel displays
PDF
Unit 3
PPT
Circle drawing algo.
PPTX
Cohen-Sutherland Line Clipping Algorithm
PPTX
Concept of basic illumination model
PPTX
COMPUTER GRAPHICS-"Projection"
PDF
4. THREE DIMENSIONAL DISPLAY METHODS
PDF
Computer Graphics - Output Primitive
PPT
Composite transformations
PPT
2 d geometric transformations
3 d display methods
Shading
Window to viewport transformation
2D viewing & clipping
Quadric surfaces
Projection In Computer Graphics
Clipping computer graphics
3D transformation in computer graphics
Projections.pptx
3D Transformation
Computer graphics - colour crt and flat-panel displays
Unit 3
Circle drawing algo.
Cohen-Sutherland Line Clipping Algorithm
Concept of basic illumination model
COMPUTER GRAPHICS-"Projection"
4. THREE DIMENSIONAL DISPLAY METHODS
Computer Graphics - Output Primitive
Composite transformations
2 d geometric transformations
Ad

Similar to 3 projection computer graphics (20)

PDF
Notes04.pdf
PDF
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
PPTX
3 d graphics with opengl part 2
PPT
projections - engineering drawing
PPT
PPT
Three dimensional concepts - Computer Graphics
PPT
Lecture3.orig.ppt
PDF
6. Perspective Projection .pdf
PDF
Computer Graphics - Lecture 03 - Virtual Cameras and the Transformation Pipeline
PDF
Cs543 15 projection
PPT
CS 354 Graphics Math
PPT
Computer Viewing
PPT
viewing-projection powerpoint cmputer graphics
PPT
Projection Matrices
PPT
3 d modeling part 1
PDF
unit-4-computer-graphics.pdf . VERY USE FULL
PPT
View in 3_d_asper_syllabus
PPT
View in 3_d_asper_syllabus
PPT
PDF
06 projection.slides (1)
Notes04.pdf
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
3 d graphics with opengl part 2
projections - engineering drawing
Three dimensional concepts - Computer Graphics
Lecture3.orig.ppt
6. Perspective Projection .pdf
Computer Graphics - Lecture 03 - Virtual Cameras and the Transformation Pipeline
Cs543 15 projection
CS 354 Graphics Math
Computer Viewing
viewing-projection powerpoint cmputer graphics
Projection Matrices
3 d modeling part 1
unit-4-computer-graphics.pdf . VERY USE FULL
View in 3_d_asper_syllabus
View in 3_d_asper_syllabus
06 projection.slides (1)
Ad

More from cairo university (20)

PPSX
Tocci chapter 13 applications of programmable logic devices extended
PPSX
Tocci chapter 12 memory devices
PPSX
Tocci ch 9 msi logic circuits
PPSX
Tocci ch 7 counters and registers modified x
PPSX
Tocci ch 6 digital arithmetic operations and circuits
PPSX
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
PPSX
A15 sedra ch 15 memory circuits
PPSX
A14 sedra ch 14 advanced mos and bipolar logic circuits
PPSX
A13 sedra ch 13 cmos digital logic circuits
PPSX
A09 sedra ch 9 frequency response
PPTX
5 sedra ch 05 mosfet.ppsx
PPSX
5 sedra ch 05 mosfet
PPSX
5 sedra ch 05 mosfet revision
PDF
Fields Lec 2
PDF
Fields Lec 1
PDF
Fields Lec 5&6
PDF
Fields Lec 4
PDF
Fields Lec 3
PPT
Lecture 2 (system overview of c8051 f020) rv01
PPT
Lecture 1 (course overview and 8051 architecture) rv01
Tocci chapter 13 applications of programmable logic devices extended
Tocci chapter 12 memory devices
Tocci ch 9 msi logic circuits
Tocci ch 7 counters and registers modified x
Tocci ch 6 digital arithmetic operations and circuits
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
A15 sedra ch 15 memory circuits
A14 sedra ch 14 advanced mos and bipolar logic circuits
A13 sedra ch 13 cmos digital logic circuits
A09 sedra ch 9 frequency response
5 sedra ch 05 mosfet.ppsx
5 sedra ch 05 mosfet
5 sedra ch 05 mosfet revision
Fields Lec 2
Fields Lec 1
Fields Lec 5&6
Fields Lec 4
Fields Lec 3
Lecture 2 (system overview of c8051 f020) rv01
Lecture 1 (course overview and 8051 architecture) rv01

Recently uploaded (20)

PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Construction Project Organization Group 2.pptx
PPTX
additive manufacturing of ss316l using mig welding
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
composite construction of structures.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Automation-in-Manufacturing-Chapter-Introduction.pdf
CYBER-CRIMES AND SECURITY A guide to understanding
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Mechanical Engineering MATERIALS Selection
Internet of Things (IOT) - A guide to understanding
OOP with Java - Java Introduction (Basics)
Construction Project Organization Group 2.pptx
additive manufacturing of ss316l using mig welding
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
R24 SURVEYING LAB MANUAL for civil enggi
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
composite construction of structures.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx

3 projection computer graphics

  • 1. SBE 306: Computer Graphics Projection Dr. Ayman Eldeib Systems & Biomedical Engineering Department Spring 2019
  • 2. Computer Graphics Projection Types of Projections Perspective Projection Parallel Projection “Orthographic ”
  • 3. Computer Graphics Projection Simple Orthographic Projection  Project all points along the z axis to the z= 0 plane                                      11000 0000 0010 0001 1 0 ' ' z y x y x
  • 4. Computer Graphics Projection Perspective Transformations  Perspective transformations do not preserve parallelism, i.e. Parallel lines not parallel; converge to single point  Further objects are smaller (size, inverse distance) B A’ B’ Center of projection (camera/eye location) A
  • 5. Computer Graphics Projection Perspective Projection  In the real world, objects exhibit perspective foreshortening: distant objects appear smaller.  The basic situation:
  • 6. Computer Graphics Projection  When we do 3-D graphics, we think of the screen as a 2-D window onto the 3-D world How tall should this bunny be? Cont. Perspective Projection
  • 7. Computer Graphics Projection  The geometry of the situation is that of similar triangles. View from above: P (x, y, z)X -Z View plane d (0,0,0) x’ = ?  What is x’ ? Cont. Perspective Projection
  • 8. Computer Graphics Projection P (x, y, z)X -Z View plane d (0,0,0) x’ = ? z y d y z x d x  ' , ' dz dz y z yd y dz x z xd x      ',',' Cont. Perspective Projection
  • 9. Computer Graphics Projection A Perspective Projection Matrix z y d y z x d x  ' , ' dz dz y z yd y dz x z xd x      ',','                d z z y x                                 1 1 ' ' ' d z yd z xd z y x                            10 1 00 0100 0010 0001 z y x d Perspective Matrix
  • 10. Computer Graphics Projection Example               0100 0100 0010 0001 d M eperspectiv                                        dz z y x z y x d 10100 0100 0010 0001 Cont. A Perspective Projection Matrix
  • 11. Computer Graphics Projection P (x, y, z)X -Z View plane d (0,0,0) x’ = ?               0100 0100 0010 0001 d M eperspectiv  View plane is at –d on z coordinate  (Only) last row affected (no longer 0 0 0 1) Cont. A Perspective Projection Matrix
  • 12. Computer Graphics Projection  Now that we can express perspective foreshortening as a matrix, we can composite it onto our other matrices with the usual matrix multiplication  End result: can create a single matrix encapsulating modeling, viewing, and projection transforms Though you recall that in practice OpenGL separates the modelview from projection matrix (why?) Cont. A Perspective Projection Matrix
  • 13. Computer Graphics Projection Defining a Viewing Region  Most graphics API’s use two methods for defining a viewing region  The viewing frustum In OpenGL glFrustum (xmin,xmax,ymin,ymax,near,far)  The screen projection plane This is a special case of the viewing frustum Also called the symmetric perspective projection frustum In OpenGL gluPerspective (theta,aspect,near,far)
  • 14. Computer Graphics Projection Viewing Frustum  void glFrustum( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far )  Parameters:  left, right: Specify the coordinates for the left and right vertical clipping planes;  bottom, top: Specify the coordinates for the bottom and top horizontal clipping planes;  near, far: Specify the distances to the near and far depth clipping planes. Both distances must be positive.
  • 15. Computer Graphics Projection  void gluPerspective( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar )  Parameters:  Fovy: Specifies the field of view angle, in degrees, in the y direction;  Aspect: Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height);  ZNear: Specifies the distance from the viewer to the near clipping plane (always positive);  ZFar: Specifies the distance from the viewer to the far clipping plane (always positive) Cont. Viewing Frustum
  • 16. Computer Graphics Projection  The viewing frustum defines a region of 3D space assuming that the eye is located at (0, 0, 0).  A 4x4 perspective transformation maps the viewing frustum to a canonical cube  Once a canonical cube is obtained 3D points are projected to 2D by dropping the z component  Note perspective projection is obtained by using a perspective transformation followed by orthographic projection Cont. Viewing Frustum
  • 17. Computer Graphics Projection  OpenGL’s gluPerspective() command generates a slightly more complicated matrix:                                               2 cotwhere 0100 2 00 000 000 y farnear nearfar farnear nearfar fov f ZZ ZZ ZZ ZΖ f aspect f Cont. Viewing Frustum