Skip to content

Commit e1d7059

Browse files
committed
committing requested changes in stages.
1 parent e57bc3d commit e1d7059

File tree

10 files changed

+323
-168
lines changed

10 files changed

+323
-168
lines changed

en/Building_a_Simple_Engine/Appendix/appendix.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
:pp: {plus}{plus}
22

33
= Appendix:
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Detailed Architectural Patterns
136

@@ -18,7 +11,7 @@ This appendix provides in-depth information about common architectural patterns
1811

1912
One of the most fundamental architectural patterns is the layered architecture, where the system is divided into distinct layers, each with a specific responsibility.
2013

21-
image::../../../images/layered_architecture_diagram.svg[Layered Architecture Diagram, width=600]
14+
image::../../../images/layered_architecture_diagram.png[Layered Architecture Diagram, width=600]
2215

2316
==== Typical Layers in a Rendering Engine
2417

en/Building_a_Simple_Engine/Camera_Transformations/01_introduction.adoc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= 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-
124
== Introduction
135

146
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.

en/Building_a_Simple_Engine/Camera_Transformations/02_math_foundations.adoc

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
:pp: {plus}{plus}
22

33
= Camera & Transformations: Mathematical Foundations
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:icons: font
8-
:source-highlighter: highlightjs
9-
:source-language: c++
104

115
== Mathematical Foundations for 3D Graphics
126

@@ -22,6 +16,7 @@ Vectors are fundamental to 3D graphics as they represent positions, directions,
2216
==== Why Vectors Matter in Graphics
2317

2418
In our camera system, vectors serve several critical purposes:
19+
2520
* The camera's position is represented as a 3D vector
2621
* The camera's viewing direction is a 3D vector
2722
* The "up" direction that orients the camera is also a vector
@@ -39,13 +34,13 @@ In our camera system, vectors serve several critical purposes:
3934

4035
==== The Right-Hand Rule
4136

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 cross products.
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.
4338

4439
* *For Cross Products*: When calculating A × B:
4540

4641
1. Point your right hand's index finger in the direction of vector A
4742
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 cross product
43+
3. Your thumb now points in the direction of the resulting cross-product
4944

5045
* *For Coordinate Systems*: In a right-handed coordinate system:
5146

@@ -72,7 +67,7 @@ glm::vec3 negativeZ = glm::cross(yAxis, xAxis); // Points backward (negative Z)
7267
- Applications: Generating the camera's "right" vector from "forward" and "up" vectors
7368
- The direction follows the right-hand rule (explained above)
7469

75-
* *Normalization*: Preserves direction while setting length to 1
70+
* *Normalization*: Preserves the direction while setting length to 1
7671
- Applications: Ensuring consistent movement speed regardless of direction
7772

7873
[source,cpp]
@@ -104,6 +99,7 @@ Matrices are used to represent transformations in 3D space. In Vulkan and other
10499
==== Why We Use 4×4 Matrices
105100

106101
Even though we work in 3D space, we use 4×4 matrices because:
102+
107103
1. They allow us to represent translation (movement) along with rotation and scaling
108104
2. They can be combined (multiplied) to create complex transformations
109105
3. They work with homogeneous coordinates (x, y, z, w) which are required for perspective projection
@@ -120,7 +116,7 @@ Even though we work in 3D space, we use 4×4 matrices because:
120116
- Less commonly used for cameras, but important for objects in the scene
121117

122118
* *Model Matrix*: Combines transformations to position an object in world space
123-
- Positions objects relative to the world origin
119+
- Positions the objects relative to the world origin
124120

125121
* *View Matrix*: Transforms world space to camera space
126122
- Essentially positions the world relative to the camera
@@ -174,7 +170,7 @@ The following diagram illustrates the difference between correct and incorrect m
174170
.Matrix Transformation Order Comparison
175171
image::../../../images/matrix-order-comparison.svg[Matrix Order Comparison showing correct T×R×S vs incorrect R×T×S transformation sequences]
176172

177-
==== Row-Major vs Column-Major Representation
173+
==== Row-Major vs. Column-Major Representation
178174

179175
When working with matrices in graphics programming, it's important to understand the difference between row-major and column-major representations:
180176

en/Building_a_Simple_Engine/Camera_Transformations/03_camera_implementation.adoc

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Camera & Transformations: Camera Implementation
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Camera Implementation
136

@@ -122,7 +115,7 @@ void Camera::processKeyboard(CameraMovement direction, float deltaTime) {
122115

123116
==== Handling Input Events
124117

125-
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):
126119

127120
[source,cpp]
128121
----
@@ -353,7 +346,7 @@ This implementation:
353346

354347
==== Occlusion Avoidance
355348

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 occlusionwhen objects in the environment block the view of the character. Here's an implementation of occlusion avoidance:
357350

358351
[source,cpp]
359352
----
@@ -398,7 +391,7 @@ When implementing occlusion avoidance, be mindful of performance:
398391

399392
* *Use simplified collision geometry*: For raycasting, use simpler collision shapes than your rendering geometry
400393
* *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
402395
* *Optimize for mobile platforms*: For performance-constrained devices, consider simplifying the occlusion algorithm or reducing its precision
403396

404397
==== Implementing Orbit Controls

en/Building_a_Simple_Engine/Camera_Transformations/03_transformation_matrices.adoc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
::pp: {plus}{plus}
1+
:pp: {plus}{plus}
22

33
= Camera & Transformations: Transformation Matrices
4-
:doctype: book
5-
:sectnums:
6-
:sectnumlevels: 4
7-
:toc: left
8-
:icons: font
9-
:source-highlighter: highlightjs
10-
:source-language: c++
114

125
== Transformation Matrices
136

@@ -92,6 +85,7 @@ glm::mat4 createPerspectiveMatrix(
9285
----
9386

9487
Parameters:
88+
9589
* `fovY`: Field of view angle in degrees (vertical)
9690
* `aspectRatio`: Width divided by height of the viewport
9791
* `nearPlane`: Distance to the near clipping plane

0 commit comments

Comments
 (0)