Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b9b12a

Browse files
authored
Update 04-maths.rst
1 parent 360f02e commit 8b9b12a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

04-maths.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ the projective dimension. In order to explain it, we'll use a 1-dimensional
4242
space where point coordinates are single scalars indicating the position of the
4343
points onto the X-axis. This will make everything clearer hopefully.
4444

45-
Let us consider for example a simple set of point `[-1.0, -0.5, 0.0, +0.5,
45+
Let us consider for example a simple set of points `[-1.0, -0.5, 0.0, +0.5,
4646
+1.0]` in this unidimensional space. We want to project onto another segment
47-
`[-2,+2]` that represent the screen (any point projected outside this segment
48-
is discared and won't be visible into the final projection) The question now is
47+
`[-2,+2]` that represents the screen (any point projected outside this segment
48+
is discared and won't be visible into the final projection). The question now is
4949
how do we project the points onto the screen?
5050

5151
.. figure:: images/chapter-04/1D-H-Coordinates.png
@@ -66,7 +66,7 @@ and default value of 1 for all the `w` such that our new point set is now
6666
`[(-1.0,1.0), -(0.5,1.0), (0.0,1.0), (+0.5,1.0), (+1.0,1.0)]`. Reciprocally, a
6767
point `(x,w)` in projective space corresponds to the point `x/w` (if `w` ≠ 0)
6868
in our unidimensional Euclidean space. From this conversion, we can see
69-
immediately that there exist actually an infinite set of homogenous coordinates
69+
immediately that there exists actually an infinite set of homogenous coordinates
7070
that correspond to a single Cartesian coordinate as illustrated on the figure.
7171

7272
.. figure:: images/chapter-04/1D-Projection.png
@@ -86,20 +86,20 @@ Projections
8686
+++++++++++
8787

8888
We are now ready to project our point set onto the screen. As shown on the
89-
figure above, we can use an orthographic (all rays are parallels) or a linear
89+
figure above, we can use an orthographic (all rays are parallel) or a linear
9090
projection (rays originate from the camera point and hit the screen, passing
9191
through points to be projected). For these two projections, results are similar
9292
but different. In the first case, distances have been exactly conserved while
9393
in the second case, the distance between projected points has increased, but
9494
projected points are still equidistant. The third projection is where
9595
homogenous coordinates make sense. For this (arbitrary) projection, we decided
96-
that the further the point is from the origin, and the further away from the
96+
that the further the point is from the origin, the further away from the
9797
origin its projection will be. To do that, we measure the distance of the point
9898
to the origin and we add this distance to its `w` value before projecting it
9999
(this corresponds to the black circles on the figure) using the linear
100100
projection. It is to be noted that this new projection does not conserve the
101101
distance relationship and if we consider the set of projected points `[P(-1.0),
102-
P(-0.5), P(0.0), P(+0.5), P(+1.0)]`, we have have `║P(-1.0)-P(-0.5)]║ >
102+
P(-0.5), P(0.0), P(+0.5), P(+1.0)]`, we have `║P(-1.0)-P(-0.5)]║ >
103103
║P(-0.5)- P(0.0)║`.
104104

105105

@@ -155,7 +155,7 @@ consider a vector to be 4 rows and 1 columns, meaning transformations happen on
155155
the left side of vectors. To transform a vertex V by a transformation matrix M,
156156
we write: V' = M*V. To chain two transformations M1 and M2 (first M1, then M2),
157157
we write: V' = M2*M1*V which is different from V' = M1*M2*V because matrix
158-
multiplication is not communative. As clearly illustrated on the right figure,
158+
multiplication is not commutative. As clearly illustrated by the figure on the right,
159159
this means for example that a rotation followed by a translation is not the
160160
same as a translation followed by a rotation.
161161

@@ -222,7 +222,7 @@ corresponding matrix is given below:
222222
Scaling
223223
+++++++
224224

225-
Considering a vertex `V = (x, y, z, 1)` and a scaling vector `T = (sx, sy, sz,
225+
Considering a vertex `V = (x, y, z, 1)` and a scaling vector `S = (sx, sy, sz,
226226
0)`, the scaling of `V` by `S` is `(sx*x, sy*y, sz*z, 1)`. The corresponding
227227
matrix is given below:
228228

@@ -309,8 +309,8 @@ A word of caution
309309
OpenGL uses a `column-major representation
310310
<https://www.opengl.org/archives/resources/faq/technical/transformations.htm>`_
311311
of matrices. This mean that when reading a set of 16 contiguous
312-
values in memory, the first 4 values corresponds to the first column while in
313-
Numpy (using C default layout), this would corresponds to the first row. In
312+
values in memory, relative to a 4×4 matrix, the first 4 values correspond to the first column while in
313+
Numpy (using C default layout), this would correspond to the first row. In
314314
order to stay consistent with most OpenGL tutorials, we'll use a column-major
315315
order in the rest of this book. This means that any glumpy transformations will
316316
appear to be transposed when displayed, but the underlying memory
@@ -374,7 +374,7 @@ GPU, but you would use on the right with Python/NumPy:
374374
Projections
375375
-------------------------------------------------------------------------------
376376

377-
In order to define a projection, we need to specify first what what do we want
377+
In order to define a projection, we need to specify first what do we want
378378
to view, that is, we need to define a viewing volume such that any object
379379
within the volume (even partially) will be rendered while objects outside
380380
won't. On the image below, the yellow and red spheres are within the volume
@@ -425,7 +425,7 @@ Perspective
425425
426426
At this point, it is not necessary to understand how these matrices were
427427
built. Suffice it to say they are standard matrices in the 3D world. Both
428-
suppose the viewer (=camera) is located at position (0,0,0) and is looking in
428+
assume the viewer (=camera) is located at position (0,0,0) and is looking in
429429
the direction (0,0,1).
430430

431431
There exists a second form of the perpective matrix that might be easier to
@@ -453,8 +453,8 @@ Model and view matrices
453453
+++++++++++++++++++++++
454454

455455
We are almost done with matrices. You may have guessed that the above matrices
456-
requires the viewing volume to be in the z direction. We could design our 3D
457-
scene such that all objects are withing this direction but it would not be very
456+
require the viewing volume to be in the z direction. We could design our 3D
457+
scene such that all objects are within this direction but it would not be very
458458
convenient. So instead, we use a view matrix that maps the world space to
459459
camera space. This is pretty much as if we were orienting the camera at a given
460460
position and look toward a given direction. In the meantime, we can further

0 commit comments

Comments
 (0)