Skip to content

Commit e71a77c

Browse files
committed
"on" -> "in" the figure/image/movies; minor grammar fixes
1 parent ac81087 commit e71a77c

7 files changed

+44
-44
lines changed

03-quickstart.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ the better) and the homogeneity of the triangles (we prefer to have triangles
7373
that have more or less the same size and to not have any degenerated triangle).
7474

7575
In our case, we want to render a square and we need to find the proper
76-
triangulation (which is not unique as illustrated on the figure). Since we want
76+
triangulation (which is not unique as illustrated in the figure). Since we want
7777
to minimize the number of triangles, we'll use the 2 triangles solution that
7878
requires only 4 (shared) vertices corresponding to the four corners of the
7979
quad. However, you can see from the figure that we could have used different
@@ -110,7 +110,7 @@ GL Primitives
110110
Ok, now things are getting serious because we need to actually tell OpenGL what
111111
to do with the vertices, i.e. how to render them? What do they describe in terms
112112
of geometrical primitives? This is quite an important topic since this will
113-
determine how fragments will actually be generated as illustrated on the image
113+
determine how fragments will actually be generated as illustrated in the image
114114
below:
115115

116116

@@ -151,12 +151,12 @@ choice, because a triangle offers the possibility of having a nice and intuitive
151151
interpolation of any point that is inside the triangle. If you look back at
152152
the graphic pipeline as it has been introduced in the `Modern OpenGL`_ section,
153153
you can see that the rasterisation requires for OpenGL to generate fragments
154-
inside the triangle but also to interpolate values (colors on the figure). One
154+
inside the triangle but also to interpolate values (colors in the figure). One
155155
of the legitimate questions to be solved is then: if I have a triangle
156156
(V₁,V₂,V₃), each summit vertex having (for example) a different color, what is
157157
the color of a fragment `p` inside the triangle? The answer is `barycentric
158158
interpolation <https://en.wikibooks.org/wiki/GLSL_Programming/Rasterization>`_
159-
as illustrated on the figure on the right.
159+
as illustrated in the figure on the right.
160160

161161
More precisely, for any point p inside a triangle `A = (V₁,V₂,V₃)`, we consider
162162
triangles:

04-maths.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ and default value of 1 for all the `w` such that our new point set is now
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
6969
immediately that there exists actually an infinite set of homogenous coordinates
70-
that correspond to a single Cartesian coordinate as illustrated on the figure.
70+
that correspond to a single Cartesian coordinate as illustrated in the figure.
7171

7272
.. figure:: images/chapter-04/1D-Projection.png
7373
:figwidth: 100%
@@ -85,7 +85,7 @@ that correspond to a single Cartesian coordinate as illustrated on the figure.
8585
Projections
8686
+++++++++++
8787

88-
We are now ready to project our point set onto the screen. As shown on the
88+
We are now ready to project our point set onto the screen. As shown in the
8989
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
@@ -96,7 +96,7 @@ homogenous coordinates make sense. For this (arbitrary) projection, we decided
9696
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
99-
(this corresponds to the black circles on the figure) using the linear
99+
(this corresponds to the black circles in 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),
102102
P(-0.5), P(0.0), P(+0.5), P(+1.0)]`, we have `║P(-1.0)-P(-0.5)]║ >
@@ -359,8 +359,8 @@ For example, here is a translation matrix as returned by the
359359
↑ ↑ ↑
360360
13 14 15
361361
362-
So this means you would use this translation on the left when uploaded to the
363-
GPU, but you would use on the right with Python/NumPy:
362+
So this means you would use the translation on the left when uploading to the
363+
GPU, but you would use that on the right with Python/NumPy:
364364

365365
.. code:: python
366366
@@ -377,16 +377,16 @@ Projections
377377
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
380-
won't. On the image below, the yellow and red spheres are within the volume
381-
while the green one is not and does not appear on the projection.
380+
won't. In the image below, the yellow and red spheres are within the volume
381+
while the green one is not and does not appear in the projection.
382382

383383
.. image:: images/chapter-04/projection.png
384384
:width: 100%
385385

386386
There exist many different ways to project a 3D volume onto a 2D screen but
387387
we'll only use the `perspective projection`_ (distant objects appear smaller)
388388
and the `orthographic projection`_ which is a parallel projection (distant
389-
objects have the same size as closer ones) as illustrated on the image
389+
objects have the same size as closer ones) as illustrated in the image
390390
above. Until now (previous section), we have been using implicitly an
391391
orthographic projection in the z=0 plane.
392392

06-anti-grain.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ circle (center and radius), the rasterizer examines the center of each pixel to
5555
determine if it falls inside or outside the shape. The result is illustrated on
5656
the right part of the figure. Even if the center of a pixel is very close but
5757
outside of the circle, it is not painted as it is shown for the thicker square
58-
on the figure. More generally, without anti-aliasing, a pixel will be only on
58+
in the figure. More generally, without anti-aliasing, a pixel will be only on
5959
(inside) or off (outside), leading to very hard jagged edges and a very
6060
approximate shape for small sizes as well.
6161

@@ -82,7 +82,7 @@ Sample based methods
8282
One of the simplest method to remove aliasing consists of using several
8383
samples to estimate the final color of a fragment. Instead of only considering
8484
the center of the pixel, one case use several samples over the whole surface of
85-
a pixel in order to have a better estimate as shown on the figure on the
85+
a pixel in order to have a better estimate as shown in the figure on the
8686
right. A fragment that was previously considered outside, based on its center
8787
only, can now be considered half inside / half outside. This multi-sampling
8888
helps to attenuate the jagged edges we've seen in the previous section. In the
@@ -160,7 +160,7 @@ Coverage methods
160160
Rendering of a disc using exact coverage anti-aliasing.
161161

162162
Another approach for anti-aliasing is to compute the exact coverage of a shape
163-
over each pixel surface as shown on the figure on the right. To do so, we need
163+
over each pixel surface as shown in the figure on the right. To do so, we need
164164
of course to know precisely the shape we want to display and where it is
165165
located in order to compute the coverage of the shape onto the pixel grid. In
166166
the figure, this corresponds to the grey areas that give us direct access to the

07-points.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ primitive that displays a quad that is always facing the camera
3838
dimension, even though we'll use this primitive to draw discs and circles in
3939
the next section. The size of the quad must be specified within the vertex
4040
shader using the `gl_PointSize` variable (note that the size is expressed in
41-
pixels). As shown on the figure, the result is quite ugly.
41+
pixels). As shown in the figure, the result is quite ugly.
4242

4343
.. code:: python
4444
@@ -173,7 +173,7 @@ Last, we setup our python program to display some discs:
173173
Circles positionned vertically with a 0.2 pixel increase.
174174
See `circles-aligned.py <code/chapter-07/circles-aligned.py>`_
175175

176-
You can see the result on the image on the right. Not only the discs are
176+
You can see the result in the image on the right. Not only the discs are
177177
properly antialiased, but they are also positionned at the subpixel level. In
178178
the image on the right, each disc is actually vertically shifted upward by 0.2
179179
pixels compared to its left neightbour. However, you cannot see any artefacts
@@ -280,7 +280,7 @@ Flat sphere
280280
A lit sphere
281281

282282
If you look closely at a sphere, you'll see that that the projected shape on
283-
screen is actually a disc as shown on the figure on the right. This is actually
283+
screen is actually a disc as shown in the figure on the right. This is actually
284284
true independently of the viewpoint and we can take advantage of it. A long
285285
time ago (with the fixed pipeline), rendering a sphere meant tesselating the
286286
sphere with a large number of triangles. The larger the number of triangles,
@@ -336,7 +336,7 @@ coordinate is maximal in the center and null on the border.
336336

337337
We're ready to simulate lighting on our disc using the `Phong model
338338
<https://en.wikipedia.org/wiki/Phong_reflection_model>`_. I won't give all the
339-
detail now because we'll see that later. However, as you can see on the source
339+
detail now because we'll see that later. However, as you can see in the source
340340
below, this is quite easy and the result is flawless.
341341

342342
.. figure:: images/chapter-07/sphere-3.png
@@ -380,7 +380,7 @@ True sphere
380380
A bunch of fake spheres.
381381

382382
We can use this technique to display several "spheres" having different sizes
383-
and positions as shown on the figure on the right. This can be used to
383+
and positions as shown in the figure on the right. This can be used to
384384
represent molecules for examples. Howewer, we have a problem with sphere
385385
intersecting each other. If you look closely the figure, you might have notices
386386
that no sphere intersect any sphere. This is due to the depth testing of the
@@ -419,7 +419,7 @@ the `gl_FragDepth` variable (that must be between 0 and 1):
419419
gl_FragColor = vec4(max(diffuse*color, specular*vec3(1.0)), 1.0);
420420
}
421421
422-
You can see on the figures that the spheres now intersect each other correctly.
422+
You can see in the figures that the spheres now intersect each other correctly.
423423

424424

425425
Exercises
@@ -436,7 +436,7 @@ Tiny discs
436436
Disc spiral
437437

438438
Adapting the shader from the "Dots, discs, circles" section, try to write a
439-
script to draw discs on a spiral as displayed on the figure on the right. Be
439+
script to draw discs on a spiral as displayed in the figure on the right. Be
440440
careful with small discs, especially when the radius is less than one pixel. In
441441
such case, you'll have to find a convincing way to suggest the size of the
442442
disc...

08-markers.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Markers
146146
Some example of markers constructed using CSG. See below for corresponding
147147
GLSL code.
148148

149-
As illustrated on the right figure creating markers is merely a matter of
149+
As illustrated in the figure on the right, creating markers is merely a matter of
150150
imagination. Try to think of a precise shape and see how you can decompose it
151151
in terms of constructive solid geometry. I've put a collection of such markers
152152
in the (open access) article `Antialiased 2D Grid, Marker, and Arrow Shaders
@@ -336,7 +336,7 @@ Arrows
336336

337337
Arrows are a bit different from markers because they are made of a body, which
338338
is a line basically, and a head. Most of the difficulty lies in the head
339-
definition that may vary a lot depending on the type the arrow. For example,
339+
definition that may vary a lot depending on the type of arrow. For example,
340340
the stealth arrow shader reads:
341341

342342
.. code:: glsl
@@ -495,8 +495,8 @@ If you run the code below, you should obtain the image on the right.
495495
image = Image.fromarray((Z*255).astype(np.ubyte))
496496
image.save("firefox-sdf.png")
497497
498-
Even though the logo is barely recognisable on the resulting image, it carries
499-
nonetheless the necessary information to compute the distance to the border
498+
Even though the logo is barely recognisable in the resulting image, it nonetheless
499+
carries the necessary information to compute the distance to the border
500500
from within the shader. When the texture will be read inside the fragment
501501
shader, we'll subtract 0.5 from the texture value (texture value are
502502
normalized, hence the 0.5) to obtain the actual signed distance field. You're
@@ -556,7 +556,7 @@ Quiver plot
556556

557557
Now that we know how to draw arrows, we can make a quiver plot very easily. The
558558
obvious solution would be to draw n arrows using 2×n triangles (since one arrow
559-
is two triangle). However, if your arrows are evenly spaced as on the figure on
559+
is two triangle). However, if your arrows are evenly spaced as in the figure on
560560
the right, there is a smarter solution using only two triangles.
561561

562562
Solution: `quiver.py <code/chapter-08/quiver.py>`_

09-lines.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ the same primitives:
448448
program.draw(gl.GL_LINE_STRIP_ADJACENCY_EXT, I)
449449
450450
451-
I won't further describe the method that is a bit complicated but you can all
452-
the details in the provided demo script. See the caption of the image below.
451+
I won't describe this method further as it is a bit complicated, but you can see
452+
all the details in the provided demo script. See the caption of the image below.
453453

454454
.. figure:: images/chapter-09/stars.png
455455
:figwidth: 100%
@@ -472,8 +472,8 @@ Bézier curves
472472

473473
Bézier demo from the `antigrain geometry library <http://antigrain.com/>`_
474474

475-
There is a huge litterature on Bézier curves and a huge litterature on GPU
476-
Bézier curves as well (+ lot of patents). I won't explain everything here
475+
There is a huge literature on Bézier curves and a huge literature on GPU
476+
Bézier curves as well (+ lots of patents). I won't explain everything here
477477
because it would require a whole book and I'm not sure I understand every
478478
aspect anyway. If you're interested in the topic, you can have a look at `A
479479
Primer on Bézier curves <https://pomax.github.io/bezierinfo>`_ by Mike
@@ -484,7 +484,7 @@ a search using the "Bézier" or "bezier" keyword (I even commited `one
484484

485485
For the time being, we'll use an approximation of Bézier curves using an
486486
`adaptive subdivision <http://antigrain.com/research/adaptive_bezier/>`_ as
487-
designed by Maxim Shemarev (and translated in Python by me, see `curves.py
487+
designed by Maxim Shemarev (and translated to Python by me, see `curves.py
488488
<code/chapter-09/curves.py>`_). You can see in the images below that this
489489
method provides a very good approximation in a reasonable number of segments
490490
(third figure on the right).
@@ -561,7 +561,7 @@ Simple dotted pattern
561561
`linestrip-dotted.py <code/chapter-09/linestrip-dotted.py>`_.
562562

563563
Rendering a simple dotted pattern is surprinsingly simple. If you look at the
564-
fragmen code from the smooth line sections, the computation of the signed
564+
fragment code from the smooth line sections, the computation of the signed
565565
distance reads:
566566

567567
.. code:: glsl
@@ -579,7 +579,7 @@ distance reads:
579579
...
580580
581581
We can slightly change this code in order to compute the signed distance to
582-
discs whose centers area spread over the whole. Do you remember that we took
582+
discs whose centers' areas spread over the whole. Do you remember that we took
583583
care of computing the line curvilinear coordinate? Having centers spread along
584584
this line is then just a matter of a modulo.
585585

@@ -611,13 +611,13 @@ this line is then just a matter of a modulo.
611611
`linestrip-spaded.py <code/chapter-09/linestrip-spaded.py>`_.
612612

613613
The animation is obtained by slowly increasing the phase that makes all dot
614-
centers to move along the lines.
614+
centers move along the lines.
615615

616616
By the way, you may have noticed that I've been using the simplest marker I
617617
could think of (disc) for the example above. But we could have used any of the
618618
marker from the previous chapter actually. For example, on the figure on the
619619
right, I use the spade marker and I've added a fading at line start and end to
620-
prevent the sudden apparition/disparition of a marker.
620+
prevent the sudden apparition/disapparition of a marker.
621621

622622

623623
Arbitrary dash patterns
@@ -630,7 +630,7 @@ explaining how this can be done. If you want to know more, just read See
630630
"`Shader-based Antialiased Dashed Stroke Polylines
631631
<http://jcgt.org/published/0002/02/08/>`_" for a full explanation as well as
632632
`Python implementation <http://jcgt.org/published/0002/02/08/code.zip>`_. The
633-
result is illustrated on the movies below.
633+
result is illustrated in the movies below.
634634

635635
.. figure:: movies/chapter-09/stars.mp4
636636
:loop:
@@ -779,7 +779,7 @@ applying the full transformation, we'll restict it to the model transformation
779779
(i.e. no view nor projection) resulting in a normal vector where the `z`
780780
coordinate indicates if the shape is orienting towards the camera. Then,
781781
depending on this, we can modulate the thickness or the color of the line as
782-
shown on the figure on the right. In this example, we modify the thickness in
782+
shown in the figure on the right. In this example, we modify the thickness in
783783
the vertex shader and the color in the fragment shader.
784784

785785

@@ -833,7 +833,7 @@ Variable thickness
833833
We've seen in the `Smooth lines`_ section how to render smooth lines using
834834
bevel joints. The thickness of the resulting line was (implicitly)
835835
constant. How would you transform the shader to have a varying thickness as
836-
illustrated on the figure on the right?
836+
illustrated in the figure on the right?
837837

838838
Solution:
839839
`linestrip-varying-thickness.py <code/chapter-09/linestrip-varying-thickness.py>`_

10-polygons.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To know if a given polygon is concave or convex, it is rather easy. Convex
2727
polygons have all their diagonals contained inside, while it is not true for
2828
concave polygons, i.e. you can find two summits such that when you connect
2929
them, the segment is outside the polygon. Another test is to find a straight
30-
line that cross a concave polygon at more than two points as shown on the
30+
line that cross a concave polygon at more than two points as shown in the
3131
figure above with the red lines.
3232

3333

@@ -60,7 +60,7 @@ render the polygon using the `gl.GL_TRIANGLE_FAN` primitives:
6060
window.clear()
6161
polygon.draw(gl.GL_TRIANGLE_FAN)
6262
63-
You can see on the figures below that it is better to use only the convex hull
63+
You can see in the figures below that it is better to use only the convex hull
6464
points to compute the triangulation. You can also check that all other points
6565
are actually inside the polygon area.
6666

@@ -100,7 +100,7 @@ Concave polygons
100100
For concave polygons, we could consider the two aforementionned cases where
101101
points are either ordered and describe the contour of the polygon or points are
102102
unordered and spread randomly onto the 2d plane. However, for the latter case,
103-
things become more difficult because the solution is not unique as shown on the
103+
things become more difficult because the solution is not unique as shown in the
104104
figure below.
105105

106106
.. figure:: images/chapter-10/concave-hull.png
@@ -139,7 +139,7 @@ library but there are others:
139139
140140
141141
142-
On the image on the right, we've parsed (see `svg.py
142+
In the image on the right, we've parsed (see `svg.py
143143
<code/chapter-10/svg.py>`_) the firefox icon SVG path and tesselated the Bézier
144144
curves into line segments. Then we have triangulated the resulting path and
145145
obtained the displayed triangulation using `gl.GL_TRIANGLES`. See `firefox.py
@@ -352,7 +352,7 @@ Antialiasing
352352

353353
As you have noticed, the polygon we've renderered so far are not antialised
354354
(because we've been using only raw triangles). While it might be possible to
355-
write a specific shader to take car of antiliasing on the border, it is far
355+
write a specific shader to take care of antialiasing on the border, it is far
356356
more easier to draw an antialiased polygon in two steps. First, we draw the
357357
interio of the polygon and then, we render a half-line on the contour. We need
358358
a half-line because we do not want the line to cover the already rendered

0 commit comments

Comments
 (0)