ift3355: infographie projections © pierre poulin, derek nowrouzezahrai dép. i.r.o. université de...
TRANSCRIPT
![Page 1: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/1.jpg)
IFT3355: InfographieProjections
© Pierre Poulin, Derek Nowrouzezahrai
Dép. I.R.O.
Université de Montréal
![Page 2: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/2.jpg)
2D et 3D
Monde en 3D Affichage en 2D
reconstruction(vision par ordinateur)
projectionclipping par la
pyramide de vuetransformationfenêtre-clôture
rendu(infographie)
![Page 3: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/3.jpg)
Projecteurs
• Projection réduit le domaine– typiquement en infographie, n=3 et m=2
• Un projecteur est un segment reliant à un centre de projection
nmP mnn <ℜ→ℜ∈ où
nP
Parallèle Perspective
![Page 4: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/4.jpg)
Projecteurs
• L’intersection d’un projecteur avec la surface de projection correspond à
• Lorsque cette surface est planaire, on parle de projection planaire
• Quelques exemples de projections non-planaires– oeil de poisson, projection omnimax, carte du
monde
mP
![Page 5: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/5.jpg)
Projection planaire
• On divise les projections planaires en– projection parallèle– projection perspective
![Page 6: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/6.jpg)
Projection parallèle
• Centre de projection est à l’infini• Direction de projection
• Projecteurs sont parallèles entre eux• Lignes parallèles en 3D demeurent parallèles après
projection• Angles entre les lignes peuvent changer
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
01112
12
12
1
1
1
2
2
2
zzyyxx
zyx
zyx
direction oupoint à l’infini
![Page 7: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/7.jpg)
Projection perspective
• Centre de projection est à une distance finie
• Taille d’un objet augmente lorsque la distance au centre de projection diminue (perspective foreshortening)
• Lignes parallèles en 3D ne sont plus parallèles après projection
• Si le centre de projection est déplacé à l’infini, on obtient une projection parallèle
![Page 8: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/8.jpg)
Projection perspective simple
Z
Y
centre deprojection
plan deprojection
d
),,( zyxP
),,( dyxP ppp
),,0( zyP
Xd
),0,( zxP
![Page 9: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/9.jpg)
Décomposition selon XZ et YZ
),,0( zyP
),,0( dyP pp
Z
Y
dcentre deprojection
),0,( zxP
),0,( dxP pp
Z
X
dcentre deprojection
dzp
p yy
z
y
d
y== :
Règle des triangles semblables:
dzp
p xx
z
x
d
x== :
![Page 10: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/10.jpg)
Matrice de base de projection
€
x p
y p
d
1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
=
x
y
zz
d
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
=
1 0 0 0
0 1 0 0
0 0 1 0
0 0 1d 0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
x
y
z
1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
Le facteur sera utilisé pour normaliserdans le cadre des coordonnées homogènes
dz
![Page 11: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/11.jpg)
Plan de projection à z=0
),0,( zxP
),0,( dxP pp
Z
X
d
centre deprojection
),0,( dzxP −
)0,0,( pp xP
Z
X
d−
centre deprojection
![Page 12: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/12.jpg)
Plan de projection à z=0
€
x p
y p
0
1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
=
x
y
0z
d +1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
=
1 0 0 0
0 1 0 0
0 0 0 0
0 0 1d 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
x
y
z
1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
T(0,0,d) M proj T(0,0,−d)
Lorsque d est à l’infini, on obtient une projection parallèle.Si la direction de projection est parallèle à la normale du plan,on parle de projection orthographique. Sinon on parle deprojection oblique.
![Page 13: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/13.jpg)
Pyramide de vue
1. Clipping avec les six plans définissant le volume de vue
2. Projection des survivants au clipping sur la fenêtre
3. Transformations en coordonnées d’affichage
centre deprojection volume
de vue
arrière-planavant-plan
![Page 14: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/14.jpg)
Volume de vue canonique
• Le clipping avec des plans arbitraires peut être coûteux, alors on transforme la pyramide de vue dans une forme canonique
- Transforme des points qui pourraient être clippés
+ Clipping sera simplifié
Z
X ou Y
-1
1
-1 0
arrière-planavant-plan
Par
allè
le
Z
X ou Y
-1
1
-1 0
arrière-plan
avant-plan
Per
spec
tive
![Page 15: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/15.jpg)
Nomenclature
• VRP: view reference point– point sur le plan de vue
• VPN: view-plane normal– normale du plan de vue où repose la fenêtre 3D
• VUP: view up vector– vecteur 3D d’alignement vertical de la fenêtre 3D
• PRP: projection reference point– point par lequel passent tous les projecteurs– ce point peut être à l’infini– DOP = (CW - PRP): direction of projection
• CW: center of the window– centre de la fenêtre rectangulaire
![Page 16: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/16.jpg)
Nomenclature
plan de vue
VRP
VPN
( )minmin ,vu
( )maxmax ,vuCW
PRP
VUP
n
v
u
![Page 17: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/17.jpg)
Espaces 3D caméra et 2D image
u
n
VUP
VUP v
VRP
plan de vue
u
v),( maxmax vu
),( minmin vu
CW
3D 2D
VRP
![Page 18: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/18.jpg)
Projection parallèle: systèmes de coordonnées
u
v
n
PRP
CW
VRP
DOP
![Page 19: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/19.jpg)
Projection parallèle: configuration finale
(1,0,0)
(0,1,0)
(-1,0,0)
(0,-1,0)
(0,0,-1)
![Page 20: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/20.jpg)
Transformations pour une projection parallèle
1. Translation du point de référence VRP du plan de vue vers l’origine
2. Alignement de la fenêtre tel que
)( VRPT −
€
A =
r1x r2x r3x 0
r1y r2y r3y 0
r1z r2z r3z 0
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
Rz :VPN → Z (r1z,r2z,r3z ) =VPN
VPN
Rx : u → X (r1x,r2x,r3x ) =VUP × Rz
VUP × Rz
Ry : v →Y (r1y,r2y,r3y ) = Rz × Rx
![Page 21: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/21.jpg)
Transformations pour une projection parallèle
3. Cisaillement pour que la direction de projection soit parallèle à l’axe des Z
€
dopx
dopy
dopz
0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
=
umax + umin
2vmax + vmin
20
1
⎡
⎣
⎢ ⎢ ⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥ ⎥ ⎥
−
prpu
prpv
prpn
1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
Z
X ou Y
0
dop
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
010000100010001
0
00
dopzdopydopx
shyshx
dopz
dopz
dopyshy
dopz
dopxshx
−=
−=
Z
X ou Y
maxmaxou vu
minminou vuFB
![Page 22: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/22.jpg)
Transformations pour une projection parallèle
4. Translation et changement d’échelle sous forme canonique
€
T − umax + umin( )
2,− vmax + vmin( )
2,−F
⎛
⎝ ⎜
⎞
⎠ ⎟ et S
2
umax − umin
,2
vmax − vmin
,1
F − B
⎛
⎝ ⎜
⎞
⎠ ⎟
)( parparparpar VRPTAShTSN −=
Z
X ou Y
1+
1−1−
![Page 23: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/23.jpg)
Projection perspective: systèmes de coordonnées
u
v
n
PRP
CW
VRP
![Page 24: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/24.jpg)
Projection perspective: configuration finale
(-1,1,-1)
(-1,-1,-1) (1,-1,-1)
(1,1,-1)
(0,0,0)
![Page 25: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/25.jpg)
Transformations pour une projection perspective
1. Translation du point de référence VRP du plan de vue vers l’origine
2. Alignement de la fenêtre tel que
)( VRPT −
€
A =
r1x r2x r3x 0
r1y r2y r3y 0
r1z r2z r3z 0
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
Rz :VPN → Z (r1z,r2z,r3z ) =VPN
VPN
Rx : u → X (r1x,r2x,r3x ) =VUP × Rz
VUP × Rz
Ry : v →Y (r1y,r2y,r3y ) = Rz × Rx
![Page 26: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/26.jpg)
Transformations pour une projection perspective
3. Translation du centre de projection vers l’origine
4. Cisaillement pour que la ligne centrale (PRP-CW) s’aligne sur l’axe Z
)( PRPT −
€
0
0
dopz
0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
=
1 0 shx 0
0 1 shy 0
0 0 1 0
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
dopx
dopy
dopz
0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
dopz
dopyshy
dopz
dopxshx
−=
−=
Z
X ou Y
0
dopCW
![Page 27: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/27.jpg)
Transformations pour une projection perspective
5. Changement d’échelle sous forme canonique
Z
X (ou Y)
0CW
( )2
minmax uux
−=
( )2
minmax uux
−−=
zpvr ′
€
pente = ±1 → umax − umin( )
2= vr ′ p z
€
S −2vr ′ p z
umax − umin
,−2vr ′ p z
vmax − vmin
,1 ⎛
⎝ ⎜
⎞
⎠ ⎟
![Page 28: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/28.jpg)
Transformations pour une projection perspective
5. Changement d’échelle sous forme canonique
Z
X (ou Y)
0CW
zpvr ′Fpvr z +′
Bpvr z +′
€
S −1
vr ′ p z + B,
−1
vr ′ p z + B,
−1
vr ′ p z + B
⎛
⎝ ⎜
⎞
⎠ ⎟
)( )( perperper VRPTAPRPTShSN −−=
zpvr ′
zpvr ′−
€
vr ′ p z + B → −1
![Page 29: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/29.jpg)
Démonstration Live
http://pixel.cs.vt.edu/courses/cs4204.html
![Page 30: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/30.jpg)
Transformation sous une forme canonique
Z
X (ou Y)
0
minz
1−1+
1−
Z
X (ou Y)
0
1−1+
1−
€
1 0 0 0
0 1 0 0
0 0 11+zmin
−zmin
1+zmin
0 0 −1 0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
pour zmin ≠ −1
![Page 31: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/31.jpg)
Clipping contre la forme canonique
• Cohen-Sutherland en 3D (6 bits)
0 ; 1
1 ; 1
1 ; 1
>−<>−<>−<
zzyyxx
![Page 32: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/32.jpg)
Projection orthographique selon Shirley et al.
l r
t
bn
f-1 +1
-1
-1
+1
+1
Volume de vue orthographique Volume de vue canonique
€
S 2r−l( )
, 2t−b( )
, 2n− f( )( )
Notes: oeil regarde vers -Z ; le haut est +Y ; n > f
€
T − l +r( )2 , − b +t( )
2 , − n + f( )2( )
![Page 33: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/33.jpg)
Projection orthographique
€
Mortho =
nx
2 0 0 nx −12
0ny
2 0ny −1
2
0 0 1 0
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
2r−l( )
0 0 0
0 2t−b( )
0 0
0 0 2n− f( )
0
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
1 0 0 − l +r( )2
0 1 0 − b +t( )2
0 0 1 − n + f( )2
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
Image de pixelsOrigine au coin inférieur gauche
€
nx × ny
![Page 34: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/34.jpg)
Projection orthographique avec vue arbitraire
u
v
we : position de vueg : direction de vuet : direction du haut
€
w =−g
g
u =t × w
t × w
v = w × u
€
Mv =
xu yu zu 0
xv yv zv 0
xw yw zw 0
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
1 0 0 −xe
0 1 0 −ye
0 0 1 −ze
0 0 0 1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
M proj = MorthoMv
eg t
![Page 35: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/35.jpg)
Projection perspective
x
y
z
x
y
z
€
l,b,n( ) €
r, t, f( )
distortion non-linéaire des coordonnées zmais conserve l’ordre en z pour
€
n ≤ z ≤ f€
x
y
z n + fn − f
zn
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
→
nxz
nyz
n + f − fnz
1
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
z = n → M persp → z = n
z = f → M persp → z = f
Propriété intéressante:
€
M persp =
1 0 0 0
0 1 0 0
0 0 n + fn − f
0 0 1n 0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
une matrice parmiplusieurs…
![Page 36: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/36.jpg)
Manipulations de la matrice perspective
€
M(hp) = (hM) p = Mp⇒ nM persp = M persp =
n 0 0 0
0 n 0 0
0 0 n + f − fn
0 0 1 0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
M persp−1 =
1n 0 0 0
0 1n 0 0
0 0 0 1
0 0 − 1fn
n + ffn
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
picking : xs, ys,zs( ) → x, y,z( )
€
nf( )M persp−1 = M persp
−1 =
f 0 0 0
0 f 0 0
0 0 0 fn
0 0 −1 n + f
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
![Page 37: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/37.jpg)
Variations sur la matrice de projection
€
M = MorthoM persp( )Mv
matrice de projection
€
M proj =
2nr−l 0 l +r
l−r 0
0 2nt−b
b +tb−t 0
0 0 f +nn− f
2 fnf −n
0 0 1 0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
€
MOpenGL =
2 n
r−l 0 l +rl−r 0
0 2 n
t−bb +tb−t 0
0 0 f + n
n − f
2 f n
n − f
0 0 −1 0
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
![Page 38: IFT3355: Infographie Projections © Pierre Poulin, Derek Nowrouzezahrai Dép. I.R.O. Université de Montréal](https://reader035.vdocuments.net/reader035/viewer/2022062417/551d9da4497959293b8d58ba/html5/thumbnails/38.jpg)
Simplifications dues au field-of-view
Si on regarde au centre de la fenêtre
€
l = −r
b = −t
Si le ratio des pixels sont égaux
€
nx
ny
=r
t
Spécifier alors laisse un seul degré de liberté, le field-of-view
€
nx,ny
€
tgθ
2
⎛
⎝ ⎜
⎞
⎠ ⎟=
t
n
€
θ2