SlideShare a Scribd company logo
1 of 14
View frustum in the context of
head tracking
How to define a correct frustum, thus
the projection matrix?
Naëm Baron - 2014
Regular frustum
Far clip distance
Near clip distance
Frustum
Camera/Head
Top View
A frustum illustrate a Projection matrix usually defined by :
near clip distance, far clip distance, FOV and aspect ratio.
Naëm Baron - 2014
Projection matrix P
The Projection matrix P is usually defined with the following relations :
Naëm Baron - 2014
𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝐹𝑂𝑉𝑦, 𝑟𝑎𝑡𝑖𝑜
or
𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝑊𝑖𝑑𝑡ℎ, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝐻𝑒𝑖𝑔ℎ𝑡
Frustum’s extent
Left
extent
Right
extent
Top View
Far clip distance
Near clip distance
Camera/Head
A Frustum can also be defined using the “extents” at near clip distance in place of the FOV + aspect
ratio.
Naëm Baron - 2014
Frustum’s extent
Left
extent
Front View
Right
extent
Bottom
extent
Top
extent
Left/right/top/bottom extent is the distance from the center…
in the left/right/top/bottom direction at the near clip distance.
Far clip plane
Near clip plane
Naëm Baron - 2014
Projection matrix P
A new relations to define P:
Naëm Baron - 2014
𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝐹𝑂𝑉𝑦, 𝑟𝑎𝑡𝑖𝑜
or
𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝑊𝑖𝑑𝑡ℎ, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝐻𝑒𝑖𝑔ℎ𝑡
or
𝑷 = 𝑓
𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒,
𝑙𝑒𝑓𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑟𝑖𝑔ℎ𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑡𝑜𝑝𝐸𝑥𝑡𝑒𝑛𝑡, 𝑏𝑜𝑡𝑡𝑜𝑚𝐸𝑥𝑡𝑒𝑛𝑡
Adding the screen
Far clip distance
Near clip distance
Camera/Head
Screen
Top View
In immersive virtual reality system like CAVE™ or Wall, the frustum has to “fit” to the screen…
Naëm Baron - 2014
Adding the screen
Far clip distance
Top View
In immersive virtual reality system like CAVE™ or Wall, the frustum has to “fit” to the screen…
…wherever the Camera/Head is positioned.
Naëm Baron - 2014
Extents: Left ≠ Right
Asymmetric frustum
Projection matrix P
Which function to choose ?
Naëm Baron - 2014
𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝐹𝑂𝑉𝑦, 𝑟𝑎𝑡𝑖𝑜
or
𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝑊𝑖𝑑𝑡ℎ, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝐻𝑒𝑖𝑔ℎ𝑡
or
𝑷 = 𝑓
𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒,
𝑙𝑒𝑓𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑟𝑖𝑔ℎ𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑡𝑜𝑝𝐸𝑥𝑡𝑒𝑛𝑡, 𝑏𝑜𝑡𝑡𝑜𝑚𝐸𝑥𝑡𝑒𝑛𝑡
Symmetric frustum only
Asymmetric frustum 
How to define the extents according to the head and screen positions ?
How to compute P using the extents ?
To get the projection matrix according to the head position :
1. Define the head position relative to the screen center.
 ℎ𝑒𝑎𝑑𝑃𝑜𝑠𝑆𝑐𝑟𝑒𝑒𝑛 = 𝑠𝑐𝑟𝑒𝑒𝑛. 𝐼𝑛𝑣𝑒𝑟𝑠𝑒𝑇𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚 ℎ𝑒𝑎𝑑𝑃𝑜𝑠𝑊𝑜𝑟𝑙𝑑 *
2. Using the screen size (width, height) you can define the frustum’s extent at the screen distance.
 𝑠𝑐𝑟𝑒𝑒𝑛𝐸𝑥𝑡𝑒𝑛𝑡. 𝐿𝑒𝑓𝑡 = −
𝑤𝑖𝑑𝑡ℎ
2
+ ℎ𝑒𝑎𝑑𝑃𝑜𝑠𝑆𝑐𝑟𝑒𝑒𝑛. 𝑋 **
3. Convert the frustum’s extent at screen distance in frustum’s extent at near clip distance.
 Using Intercept theorem:
𝑒𝑥𝑡𝑒𝑛𝑡. 𝐿𝑒𝑓𝑡 =
𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒
𝑠𝑐𝑟𝑒𝑒𝑛𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒
∗ 𝑠𝑐𝑟𝑒𝑒𝑛𝐸𝑥𝑡𝑒𝑛𝑡. 𝐿𝑒𝑓𝑡
4. Compute the Projection matrix using the near clip extents.
____________________________________________________________________________________________________________
projMtx.m00 = (2.0f * nearClipDistance) / (extent.Right - extent.Left);
projMtx.m02 = (extent.Right + extent.Left) / (extent.Right - extent.Left);
projMtx.m11 = (2.0f * nearClipDistance) / (extent.Top - extent.Bottom);
projMtx.m12 = (extent.Top + extent.Bottom) / (extent.Top - extent.Bottom);
projMtx.m22 = -(farClipDistance + nearClipDistance) / (farClipDistance - nearClipDistance);
projMtx.m23 = (-2.0f * farClipDistance * nearClipDistance) / (farClipDistance - nearClipDistance);
projMtx.m32 = -1.0f;
____________________________________________________________________________________________________________
P from head and screen positions
* InverseTransform convert position from world space to screen local space
** X, Y or Z depending on the coordinate system
Naëm Baron - 2014
Intercept Theorem ?
A
B
C
D
E
𝐷𝐸 ‖ 𝐵𝐶

𝐴𝐷
𝐷𝐵
=
𝐴𝐸
𝐸𝐶
and
𝑫𝑬
𝑩𝑪
=
[𝑨𝑫]
[𝑨𝑩]
Math proof: http://math.stackexchange.com/questions/92929/similar-triangle-theorem-in-the-incommensurable-case/92933#92933
Simple explanation:
∠BAC and ∠DAE are “proportionally” the same.
Thus, the sides are also “proportionally” the same.
In fine, the respective quotients of the sides are equals.
Naëm Baron - 2014
Back to frustum
Top View
We can use the “Intercept Theorem” to convert the screen extents to near clip extents.
A
BC
DE
𝐴𝐷 = 𝑁𝑒𝑎𝑟 𝑐𝑙𝑖𝑝 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒
𝐴𝐵 = 𝑆𝑐𝑟𝑒𝑒𝑛 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒
𝐵𝐶 = 𝐿𝑒𝑓𝑡 𝑠𝑐𝑟𝑒𝑒𝑛′ 𝑠 𝑒𝑥𝑡𝑒𝑛𝑡
𝑫𝑬 = ?
𝐷𝐸 =
𝐴𝐷
𝐴𝐵
∗ 𝐵𝐶
𝐷𝐸 is the left extent at near clip distance.
Naëm Baron - 2014
Final note
At each tracking frame (not rendering frame):
Naëm Baron - 2014
1
• Define the head position relative to the
screen center.
2
• Define the frustum’s extent at the screen
distance.
3
• Extent at screen distance  Extent at near
clip distance.
4
• Compute Projection matrix
Left, Right, Top, Bottom
Left, Right, Top, Bottom
return;
Naëm Baron
Naem.Baron—gmail•com
Additional resources:
http://paulbourke.net/stereographics/stereorender/
http://schabby.de/projection-matrix/
http://simply3d.wordpress.com/2009/05/30/perspective-projection-part-3/
http://msdn.microsoft.com/en-us/library/windows/desktop/bb205353(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd373537(v=vs.85).aspx

More Related Content

What's hot

La culture de l’entreprise
La culture de l’entrepriseLa culture de l’entreprise
La culture de l’entrepriseMariem SELLAMI
 
Ia project Apprentissage Automatique
Ia project Apprentissage AutomatiqueIa project Apprentissage Automatique
Ia project Apprentissage AutomatiqueNizar Bechir
 
Cours information communication : stratégie marketing - segmentation, ciblage...
Cours information communication : stratégie marketing - segmentation, ciblage...Cours information communication : stratégie marketing - segmentation, ciblage...
Cours information communication : stratégie marketing - segmentation, ciblage...Adrien Quenette
 
Les tiers lieux, de nouveaux espaces pour travailler autrement
Les tiers lieux, de nouveaux espaces pour travailler autrementLes tiers lieux, de nouveaux espaces pour travailler autrement
Les tiers lieux, de nouveaux espaces pour travailler autrementL'Institut Paris Region
 
Cours marketing résumé
Cours marketing résuméCours marketing résumé
Cours marketing résuméKerim Bouzouita
 
Marketing international
Marketing internationalMarketing international
Marketing internationalsohaylaba
 
CWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benazizCWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benazizCapgemini
 
Marque marwa nouvelle stratégie digitale
Marque marwa nouvelle stratégie digitale Marque marwa nouvelle stratégie digitale
Marque marwa nouvelle stratégie digitale maryaslm
 
La fidélisation et la servuction dans le Marketing des services
La fidélisation et la servuction dans le Marketing des servicesLa fidélisation et la servuction dans le Marketing des services
La fidélisation et la servuction dans le Marketing des servicesHanae Guenouni
 
Projet personnel et professionel
Projet personnel et professionelProjet personnel et professionel
Projet personnel et professionelLaureanne Shiro
 
Community Management: quelle(s) stratégie(s)?
Community Management: quelle(s) stratégie(s)?Community Management: quelle(s) stratégie(s)?
Community Management: quelle(s) stratégie(s)?Jérôme Naif
 
Plan de communication (1)
Plan de communication (1)Plan de communication (1)
Plan de communication (1)Hayet Yetha
 
Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!
Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!
Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!Drake International
 
Web1.0.web2.0 web3.0 et web invisible
Web1.0.web2.0 web3.0 et web invisibleWeb1.0.web2.0 web3.0 et web invisible
Web1.0.web2.0 web3.0 et web invisibletassadit ALLOUNE
 
L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...
L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...
L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...Stéphane Goyard
 

What's hot (20)

La culture de l’entreprise
La culture de l’entrepriseLa culture de l’entreprise
La culture de l’entreprise
 
Ia project Apprentissage Automatique
Ia project Apprentissage AutomatiqueIa project Apprentissage Automatique
Ia project Apprentissage Automatique
 
NIVEA - Brand Management
NIVEA - Brand ManagementNIVEA - Brand Management
NIVEA - Brand Management
 
Cours information communication : stratégie marketing - segmentation, ciblage...
Cours information communication : stratégie marketing - segmentation, ciblage...Cours information communication : stratégie marketing - segmentation, ciblage...
Cours information communication : stratégie marketing - segmentation, ciblage...
 
Les tiers lieux, de nouveaux espaces pour travailler autrement
Les tiers lieux, de nouveaux espaces pour travailler autrementLes tiers lieux, de nouveaux espaces pour travailler autrement
Les tiers lieux, de nouveaux espaces pour travailler autrement
 
Marketing des services
Marketing des servicesMarketing des services
Marketing des services
 
Cours marketing résumé
Cours marketing résuméCours marketing résumé
Cours marketing résumé
 
Marketing international
Marketing internationalMarketing international
Marketing international
 
Positionnement
PositionnementPositionnement
Positionnement
 
La campagne Axe
La campagne AxeLa campagne Axe
La campagne Axe
 
CWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benazizCWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benaziz
 
Marque marwa nouvelle stratégie digitale
Marque marwa nouvelle stratégie digitale Marque marwa nouvelle stratégie digitale
Marque marwa nouvelle stratégie digitale
 
Digitalisation v.1.1
Digitalisation v.1.1Digitalisation v.1.1
Digitalisation v.1.1
 
La fidélisation et la servuction dans le Marketing des services
La fidélisation et la servuction dans le Marketing des servicesLa fidélisation et la servuction dans le Marketing des services
La fidélisation et la servuction dans le Marketing des services
 
Projet personnel et professionel
Projet personnel et professionelProjet personnel et professionel
Projet personnel et professionel
 
Community Management: quelle(s) stratégie(s)?
Community Management: quelle(s) stratégie(s)?Community Management: quelle(s) stratégie(s)?
Community Management: quelle(s) stratégie(s)?
 
Plan de communication (1)
Plan de communication (1)Plan de communication (1)
Plan de communication (1)
 
Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!
Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!
Développer des Leaders Efficaces: un Atout Stratégique pour votre Organisation!
 
Web1.0.web2.0 web3.0 et web invisible
Web1.0.web2.0 web3.0 et web invisibleWeb1.0.web2.0 web3.0 et web invisible
Web1.0.web2.0 web3.0 et web invisible
 
L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...
L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...
L'Art du Storytelling, Meeting Chocolatiers Confiseurs de France, Turin, 8 ju...
 

Recently uploaded

Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Studentskannan348865
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsVIEW
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisDr.Costas Sachpazis
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024EMMANUELLEFRANCEHELI
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashidFaiyazSheikh
 
Intro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniIntro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniR. Sosa
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfssuser5c9d4b1
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligencemahaffeycheryld
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxKarpagam Institute of Teechnology
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docxrahulmanepalli02
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdfKamal Acharya
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualBalamuruganV28
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1T.D. Shashikala
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalSwarnaSLcse
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfEr.Sonali Nasikkar
 
engineering chemistry power point presentation
engineering chemistry  power point presentationengineering chemistry  power point presentation
engineering chemistry power point presentationsj9399037128
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdfAlexander Litvinenko
 

Recently uploaded (20)

Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Students
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Intro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniIntro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney Uni
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdf
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
engineering chemistry power point presentation
engineering chemistry  power point presentationengineering chemistry  power point presentation
engineering chemistry power point presentation
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 

View frustum in the context of head tracking

  • 1. View frustum in the context of head tracking How to define a correct frustum, thus the projection matrix? Naëm Baron - 2014
  • 2. Regular frustum Far clip distance Near clip distance Frustum Camera/Head Top View A frustum illustrate a Projection matrix usually defined by : near clip distance, far clip distance, FOV and aspect ratio. Naëm Baron - 2014
  • 3. Projection matrix P The Projection matrix P is usually defined with the following relations : Naëm Baron - 2014 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝐹𝑂𝑉𝑦, 𝑟𝑎𝑡𝑖𝑜 or 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝑊𝑖𝑑𝑡ℎ, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝐻𝑒𝑖𝑔ℎ𝑡
  • 4. Frustum’s extent Left extent Right extent Top View Far clip distance Near clip distance Camera/Head A Frustum can also be defined using the “extents” at near clip distance in place of the FOV + aspect ratio. Naëm Baron - 2014
  • 5. Frustum’s extent Left extent Front View Right extent Bottom extent Top extent Left/right/top/bottom extent is the distance from the center… in the left/right/top/bottom direction at the near clip distance. Far clip plane Near clip plane Naëm Baron - 2014
  • 6. Projection matrix P A new relations to define P: Naëm Baron - 2014 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝐹𝑂𝑉𝑦, 𝑟𝑎𝑡𝑖𝑜 or 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝑊𝑖𝑑𝑡ℎ, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝐻𝑒𝑖𝑔ℎ𝑡 or 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑙𝑒𝑓𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑟𝑖𝑔ℎ𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑡𝑜𝑝𝐸𝑥𝑡𝑒𝑛𝑡, 𝑏𝑜𝑡𝑡𝑜𝑚𝐸𝑥𝑡𝑒𝑛𝑡
  • 7. Adding the screen Far clip distance Near clip distance Camera/Head Screen Top View In immersive virtual reality system like CAVE™ or Wall, the frustum has to “fit” to the screen… Naëm Baron - 2014
  • 8. Adding the screen Far clip distance Top View In immersive virtual reality system like CAVE™ or Wall, the frustum has to “fit” to the screen… …wherever the Camera/Head is positioned. Naëm Baron - 2014 Extents: Left ≠ Right Asymmetric frustum
  • 9. Projection matrix P Which function to choose ? Naëm Baron - 2014 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝐹𝑂𝑉𝑦, 𝑟𝑎𝑡𝑖𝑜 or 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝑊𝑖𝑑𝑡ℎ, 𝑛𝑒𝑎𝑟𝑃𝑙𝑎𝑛𝑒𝐻𝑒𝑖𝑔ℎ𝑡 or 𝑷 = 𝑓 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑓𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒, 𝑙𝑒𝑓𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑟𝑖𝑔ℎ𝑡𝐸𝑥𝑡𝑒𝑛𝑡, 𝑡𝑜𝑝𝐸𝑥𝑡𝑒𝑛𝑡, 𝑏𝑜𝑡𝑡𝑜𝑚𝐸𝑥𝑡𝑒𝑛𝑡 Symmetric frustum only Asymmetric frustum  How to define the extents according to the head and screen positions ? How to compute P using the extents ?
  • 10. To get the projection matrix according to the head position : 1. Define the head position relative to the screen center.  ℎ𝑒𝑎𝑑𝑃𝑜𝑠𝑆𝑐𝑟𝑒𝑒𝑛 = 𝑠𝑐𝑟𝑒𝑒𝑛. 𝐼𝑛𝑣𝑒𝑟𝑠𝑒𝑇𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚 ℎ𝑒𝑎𝑑𝑃𝑜𝑠𝑊𝑜𝑟𝑙𝑑 * 2. Using the screen size (width, height) you can define the frustum’s extent at the screen distance.  𝑠𝑐𝑟𝑒𝑒𝑛𝐸𝑥𝑡𝑒𝑛𝑡. 𝐿𝑒𝑓𝑡 = − 𝑤𝑖𝑑𝑡ℎ 2 + ℎ𝑒𝑎𝑑𝑃𝑜𝑠𝑆𝑐𝑟𝑒𝑒𝑛. 𝑋 ** 3. Convert the frustum’s extent at screen distance in frustum’s extent at near clip distance.  Using Intercept theorem: 𝑒𝑥𝑡𝑒𝑛𝑡. 𝐿𝑒𝑓𝑡 = 𝑛𝑒𝑎𝑟𝐶𝑙𝑖𝑝𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑠𝑐𝑟𝑒𝑒𝑛𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 ∗ 𝑠𝑐𝑟𝑒𝑒𝑛𝐸𝑥𝑡𝑒𝑛𝑡. 𝐿𝑒𝑓𝑡 4. Compute the Projection matrix using the near clip extents. ____________________________________________________________________________________________________________ projMtx.m00 = (2.0f * nearClipDistance) / (extent.Right - extent.Left); projMtx.m02 = (extent.Right + extent.Left) / (extent.Right - extent.Left); projMtx.m11 = (2.0f * nearClipDistance) / (extent.Top - extent.Bottom); projMtx.m12 = (extent.Top + extent.Bottom) / (extent.Top - extent.Bottom); projMtx.m22 = -(farClipDistance + nearClipDistance) / (farClipDistance - nearClipDistance); projMtx.m23 = (-2.0f * farClipDistance * nearClipDistance) / (farClipDistance - nearClipDistance); projMtx.m32 = -1.0f; ____________________________________________________________________________________________________________ P from head and screen positions * InverseTransform convert position from world space to screen local space ** X, Y or Z depending on the coordinate system Naëm Baron - 2014
  • 11. Intercept Theorem ? A B C D E 𝐷𝐸 ‖ 𝐵𝐶  𝐴𝐷 𝐷𝐵 = 𝐴𝐸 𝐸𝐶 and 𝑫𝑬 𝑩𝑪 = [𝑨𝑫] [𝑨𝑩] Math proof: http://math.stackexchange.com/questions/92929/similar-triangle-theorem-in-the-incommensurable-case/92933#92933 Simple explanation: ∠BAC and ∠DAE are “proportionally” the same. Thus, the sides are also “proportionally” the same. In fine, the respective quotients of the sides are equals. Naëm Baron - 2014
  • 12. Back to frustum Top View We can use the “Intercept Theorem” to convert the screen extents to near clip extents. A BC DE 𝐴𝐷 = 𝑁𝑒𝑎𝑟 𝑐𝑙𝑖𝑝 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝐴𝐵 = 𝑆𝑐𝑟𝑒𝑒𝑛 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝐵𝐶 = 𝐿𝑒𝑓𝑡 𝑠𝑐𝑟𝑒𝑒𝑛′ 𝑠 𝑒𝑥𝑡𝑒𝑛𝑡 𝑫𝑬 = ? 𝐷𝐸 = 𝐴𝐷 𝐴𝐵 ∗ 𝐵𝐶 𝐷𝐸 is the left extent at near clip distance. Naëm Baron - 2014
  • 13. Final note At each tracking frame (not rendering frame): Naëm Baron - 2014 1 • Define the head position relative to the screen center. 2 • Define the frustum’s extent at the screen distance. 3 • Extent at screen distance  Extent at near clip distance. 4 • Compute Projection matrix Left, Right, Top, Bottom Left, Right, Top, Bottom