Lecture 20
Lecture 20
Graphics
Lecture 20
Computer Graphics
Lecture 20
PROJECTIONS
II
Taqdees A. Siddiqi
[email protected]
Prospective Projection
w 0 0 0
0 h 0 0
0 0 q 1
0 0 q( Znear ) 0
Just for a sanity check, check out the result of this
matrix multiplication:
w 0 0 0
0 h 0 0 wx hy qz q(Znear ) z
x y z 1 0 0 q 1
0 0 q( Znear ) 0
Since, after the multiplication, ‘w’ is set to z (which can
be any value)
All four components need to be divided by z to get
normalized.
This gives the following Cartesian coordinates:
wx hy ( Znear )
z z q 1 1
Z
As you can see, this is exactly what was wanted. The
width and height are still scaled by values as in the
above equation and they are still divided by z
We then multiply the world, view, and projection
matrices together (in that order) to get a total matrix
that transforms point from object space to screen
space
Vworld = VlocalMworld
Vview =VworldMview
Vscreen = VviewMprojecton
Vscreen = Vlocal (MworldMviewMprojection)
The Viewing Frustm
h cot fov h
2
Zf
Q
Zf Zn