Computer Graphic
-
Upload
raja-mcgee -
Category
Documents
-
view
34 -
download
2
description
Transcript of Computer Graphic
Computer Graphic
Creator: Mohsen Asghari
Session 6
Fall 2014
Agenda Projection Matrix Perspective Projection Matrix Ortho Calculate Parameters of Perspective Model View matrix Camera (LookAt)
Projection Matrix (Perspective)
Projection Matrix (Perspective)
π΄π΅=ππ·πΈ=βπ π§ πΈπΉ=π π¦
π΅πΆ=π π π¦ππ π¦=
π π¦βπβπ π§
ππ π₯=ππ₯βπβπ π§
Unit Cube
Projection Matrix (Perspective)πβ€ ππ π₯ β€π 0β€π π π₯βπβ€π βπ
0β€ππ π₯β ππ βπ
β€1 0β€2βππ π₯βππ β π
β€2
β1β€2βππ π₯β ππ βπ
β1β€1
β1β€2βππ π₯
π βπ βπ+ ππ βπ
β€1
β1β€2πβππ₯
β ππ§ΒΏ ΒΏ
ππ π₯=ππ₯βπβπ π§
Projection Matrix (Perspective)
[ 2ππ β π 0π+ ππβ π
0
β¦ β¦ β¦ β¦β¦0
β¦0
β¦β1
β¦0
]β1β€
2πβππ¦
βππ§ ΒΏΒΏ [2ππ β π
0π+ππ β π
0
02ππ‘βπ
π‘+ππ‘βπ
0
00
00
π΄β1
π΅0
]
Projection Matrix (Perspective)
ππ π§=π΄π π§+π΅π π π€=βπ π§
β1=π΄ ππ§+π΅ππ π€=βπ π§
1=π΄π π§+π΅π π π€=βπ π§
π€hπππ π§=π
π€hπππ π§= π{βππ΄+π΅=βπ β ππ΄+π΅=β π
Projection Matrix (Perspective)
A=βπ +ππ βπ
B=β2 πππ βπ
[2ππ β π
0π+ππ β π
0
02ππ‘βπ
π‘+ππ‘βπ
0
00
00
βπ +ππ βπβ1
β2 πππ βπ0
]
Question?All the matrix is related to Left = l right = rBottom = bTop = tNear = nFar = f
πππ‘πππ₯ 4 .πͺππππππ·ππππππππππ (πΉππ ,π΄π ππππ‘ βπ ππ‘πππ ,ππππ ,πΉππ )
Calculate l,r,b,t BY (FOV) β (asp-r)
tan( πΉππ2 )βππππ=π‘ππ
ππ ππππ‘ βπππ‘πππ=π€πππ‘ hhπππh π‘
tan( πΉππ2 )βππππ βππ πβπ=πππh π‘
ProjectionMatrix Projection Matrix (GL_PROJECTION)
GL_PROJECTION matrix is used to define the frustum. This frustum determines which objects or portions of objects will be clipped out. Also, it determines how the 3D scene is projected onto the screen. (Please see more details
Ortho Perspective
Model View Matrix"World Matrix" and a "View Matrix", they are both transformation matrices.
View LookAt() Eye Target Up
END OF SESSION 5
ANY QUESTION?