You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/Building_a_Simple_Engine/Appendix/appendix.adoc
+1-8Lines changed: 1 addition & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,6 @@
1
1
:pp: {plus}{plus}
2
2
3
3
= Appendix:
4
-
:doctype: book
5
-
:sectnums:
6
-
:sectnumlevels: 4
7
-
:toc: left
8
-
:icons: font
9
-
:source-highlighter: highlightjs
10
-
:source-language: c++
11
4
12
5
== Detailed Architectural Patterns
13
6
@@ -18,7 +11,7 @@ This appendix provides in-depth information about common architectural patterns
18
11
19
12
One of the most fundamental architectural patterns is the layered architecture, where the system is divided into distinct layers, each with a specific responsibility.
Copy file name to clipboardExpand all lines: en/Building_a_Simple_Engine/Camera_Transformations/01_introduction.adoc
+1-9Lines changed: 1 addition & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,6 @@
1
-
::pp: {plus}{plus}
1
+
:pp: {plus}{plus}
2
2
3
3
= Camera & Transformations: Introduction
4
-
:doctype: book
5
-
:sectnums:
6
-
:sectnumlevels: 4
7
-
:toc: left
8
-
:icons: font
9
-
:source-highlighter: highlightjs
10
-
:source-language: c++
11
-
12
4
== Introduction
13
5
14
6
Welcome to the "Camera & Transformations" chapter of our "Building a Simple Engine" series! In this chapter, we'll dive into the essential mathematics and techniques needed to implement a 3D camera system in Vulkan.
Copy file name to clipboardExpand all lines: en/Building_a_Simple_Engine/Camera_Transformations/02_math_foundations.adoc
+7-11Lines changed: 7 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,6 @@
1
1
:pp: {plus}{plus}
2
2
3
3
= Camera & Transformations: Mathematical Foundations
4
-
:doctype: book
5
-
:sectnums:
6
-
:sectnumlevels: 4
7
-
:icons: font
8
-
:source-highlighter: highlightjs
9
-
:source-language: c++
10
4
11
5
== Mathematical Foundations for 3D Graphics
12
6
@@ -22,6 +16,7 @@ Vectors are fundamental to 3D graphics as they represent positions, directions,
22
16
==== Why Vectors Matter in Graphics
23
17
24
18
In our camera system, vectors serve several critical purposes:
19
+
25
20
* The camera's position is represented as a 3D vector
26
21
* The camera's viewing direction is a 3D vector
27
22
* The "up" direction that orients the camera is also a vector
@@ -39,13 +34,13 @@ In our camera system, vectors serve several critical purposes:
39
34
40
35
==== The Right-Hand Rule
41
36
42
-
The right-hand rule is a convention used in 3D graphics and mathematics to determine the orientation of coordinate systems and the direction of crossproducts.
37
+
The right-hand rule is a convention used in 3D graphics and mathematics to determine the orientation of coordinate systems and the direction of cross-products.
43
38
44
39
* *For Cross Products*: When calculating A × B:
45
40
46
41
1. Point your right hand's index finger in the direction of vector A
47
42
2. Point your middle finger in the direction of vector B (perpendicular to A)
48
-
3. Your thumb now points in the direction of the resulting crossproduct
43
+
3. Your thumb now points in the direction of the resulting cross-product
49
44
50
45
* *For Coordinate Systems*: In a right-handed coordinate system:
The camera class provides methods to process input, but you'll need to connect these to your application's input system. Here's how you might capture keyboard and mouse input using GLFW (a common windowing library used with Vulkan):
118
+
The camera class provides methods to process input, but you'll need to connect these to your application's input system. Here's how you might capture keyboard and mouse input using GLFW, (a common windowing library used with Vulkan):
126
119
127
120
[source,cpp]
128
121
----
@@ -353,7 +346,7 @@ This implementation:
353
346
354
347
==== Occlusion Avoidance
355
348
356
-
One of the most challenging aspects of a third-person camera is handling occlusion - when objects in the environment block the view of the character. Here's an implementation of occlusion avoidance:
349
+
One of the most challenging aspects of a third-person camera is handling occlusion—when objects in the environment block the view of the character. Here's an implementation of occlusion avoidance:
357
350
358
351
[source,cpp]
359
352
----
@@ -398,7 +391,7 @@ When implementing occlusion avoidance, be mindful of performance:
398
391
399
392
* *Use simplified collision geometry*: For raycasting, use simpler collision shapes than your rendering geometry
400
393
* *Limit the frequency of occlusion checks*: You may not need to check every frame on slower devices
401
-
* *Consider spatial partitioning*: Use structures like octrees to accelerate raycasts by quickly eliminating objects that can't possibly intersect with the ray
394
+
* *Consider spatial partitioning*: Use structures like octrees to speed up raycasts by quickly eliminating objects that can't possibly intersect with the ray
402
395
* *Optimize for mobile platforms*: For performance-constrained devices, consider simplifying the occlusion algorithm or reducing its precision
0 commit comments