3D Graphics for Game Programming 1st Edition Junghyun Han 2024 scribd download
3D Graphics for Game Programming 1st Edition Junghyun Han 2024 scribd download
https://ebookfinal.com/download/3d-game-programming-for-teens-second-
revised-edition-maneesh-sethi/
https://ebookfinal.com/download/microsoft-xna-unleashed-graphics-and-
game-programming-for-xbox-360-and-windows-1st-ed-edition-carter/
https://ebookfinal.com/download/advanced-3d-game-programming-with-
directx-9-wordware-game-developer-s-library-600th-edition-peter-walsh/
https://ebookfinal.com/download/introduction-to-3d-game-programming-
with-directx-10-1st-edition-frank-d-luna/
3D Game Engine Design A Practical Approach to Real Time
Computer Graphics 2nd Edition David H. Eberly
https://ebookfinal.com/download/3d-game-engine-design-a-practical-
approach-to-real-time-computer-graphics-2nd-edition-david-h-eberly/
https://ebookfinal.com/download/symbolic-dynamics-and-geometry-using-
d-in-graphics-and-game-programming-1st-edition-brian-guenter-author/
https://ebookfinal.com/download/c-game-programming-for-serious-game-
creation-1st-edition-daniel-schuller/
https://ebookfinal.com/download/c-game-programming-for-serious-game-
creation-1st-edition-daniel-schuller-2/
https://ebookfinal.com/download/love-for-lua-game-programming-1st-
edition-akinlaja/
3D Graphics for Game Programming 1st Edition
Junghyun Han Digital Instant Download
Author(s): JungHyun Han
ISBN(s): 9781439827376, 1439827370
Edition: 1
File Details: PDF, 29.92 MB
Year: 2011
Language: english
3D Graphics for
Game Programming
This page intentionally left blank
3D Graphics for
Game Programming
JungHyun Han
Korea University, Seoul, South Korea
This book contains information obtained from authentic and highly regarded sources. Reasonable
efforts have been made to publish reliable data and information, but the author and publisher cannot
assume responsibility for the validity of all materials or the consequences of their use. The authors and
publishers have attempted to trace the copyright holders of all material reproduced in this publication
and apologize to copyright holders if permission to publish in this form has not been obtained. If any
copyright material has not been acknowledged please write and let us know so we may rectify in any
future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information stor-
age or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copy-
right.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222
Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that pro-
vides licenses and registration for a variety of users. For organizations that have been granted a pho-
tocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are
used only for identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
Dedication
i
Contents
Preface ix
2 Vertex Processing 23
2.1 World Transform . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.1.1 Affine Transforms and Homogeneous Coordinates . . . 25
2.1.2 World Matrix . . . . . . . . . . . . . . . . . . . . . . . 27
2.1.3 Euler Transform . . . . . . . . . . . . . . . . . . . . . 31
2.1.4 Transform of Surface Normals . . . . . . . . . . . . . . 32
2.2 View Transform . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.2.1 Camera Space . . . . . . . . . . . . . . . . . . . . . . 35
2.2.2 Space Change and View Matrix . . . . . . . . . . . . . 36
2.3 Per-vertex Lighting . . . . . . . . . . . . . . . . . . . . . . . 41
2.4 Projection Transform . . . . . . . . . . . . . . . . . . . . . . 41
2.4.1 View Frustum . . . . . . . . . . . . . . . . . . . . . . . 42
2.4.2 Projection Matrix . . . . . . . . . . . . . . . . . . . . 43
2.4.3 Derivation of Projection Matrix∗ . . . . . . . . . . . . 48
3 Rasterization 53
3.1 Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.2 Perspective Division . . . . . . . . . . . . . . . . . . . . . . . 54
3.3 Back-face Culling . . . . . . . . . . . . . . . . . . . . . . . . 56
3.4 Coordinate Systems - Revisited∗ . . . . . . . . . . . . . . . . 59
3.4.1 3ds Max to OpenGL - Axis Flipping . . . . . . . . . . 60
3.4.2 OpenGL to Direct3D - Reflection . . . . . . . . . . . . 60
3.4.3 OpenGL to Direct3D - Vertex Reordering . . . . . . . 64
3.5 Viewport Transform . . . . . . . . . . . . . . . . . . . . . . . 66
3.6 Scan Conversion . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.7 Application: Object Picking . . . . . . . . . . . . . . . . . . 75
v
vi
References 311
Preface
ix
x
Acknowledgements
1 Themajor components of level design include laying out the game map, placing the game
characters and objects (such as enemies and obstacles), and specifying their behaviors in
response to the user actions or the events of the game world.
1
2 3D Graphics for Game Programming
Fig. 1.2: Almost all 3D models in games are represented in polygon meshes.
pipeline shown in Fig. 1.1. It is called pipeline in the sense that the output
of one step is taken as the input of the next step. The pipeline in Fig. 1.1
is defined from the graphics viewpoint, and therefore graphic artists and pro-
grammers are the key players. The artists create graphics assets and are in
charge of modeling and ‘half’ of animation. The programmers are in charge of
the other half of animation and rendering. Roughly speaking, the animation
step is partitioned into off-line tasks and run-time tasks, which are handled
by artists and programmers, respectively.
In the modeling step, the artists create the components of the game en-
vironment. Consider a shooting game in an outdoor environment. We need
soldiers, guns, terrain maps, etc. See Fig. 1.2. They are usually modeled in
polygons, and such a representation is named polygon mesh. It is the most
popular modeling method in games.
The scope of modeling is not limited to constructing 3D models, but includes
creating textures that are added to 3D models to increase their visual realism.
The simplest form of a texture is a bitmap image that is pasted to an object
surface. Fig. 1.3-(a) shows an image texture created for the soldier model.
The texture is applied to the surface of the soldier at run time, to produce
the result shown in Fig. 1.3-(b).
Modeling in Game Production 3
Fig. 1.3: An image texture applied to the surface of a polygon mesh. (a)
This example is a collection of small images, each of which is for a part of
the soldier’s body. At first glance, the texture may look weird. Section 4.1
presents how to create such an image texture. (b) The texture is pasted to
the soldier’s polygon mesh at run time.
Fig. 1.4: A skeleton is composed of bones and is embedded into the polygon
mesh. This figure illustrates the bones as if they were surfaces, but the bones
do not have explicit geometric representations. They are conceptual entities
that are usually represented as matrices. Chapter 11 presents this issue in
detail.
4 3D Graphics for Game Programming
Fig. 1.5: The polygon mesh can be animated by controlling its skeleton.
The soldier should be able to walk, run, and crawl, i.e., it needs to be
animated. For this purpose, we usually specify the skeletal structure of the
soldier and then define how the skeletal motion deforms the soldier’s polygon
mesh such that, for example, the polygons of the thigh are made to move
when the thigh-bone moves. This process is often referred to as rigging. Fig.
1.4 shows a skeleton embedded into the polygon model. A rigged model is
animated by artists. (The animations are then replayed at run time.) Fig.
1.5 shows a few snapshots of an animated soldier in wireframes.
The artists perform modeling and animation in an off-line mode. Dedicated
programs such as Autodesk 3ds Max and Autodesk Maya are popularly used.
This book uses 3ds Max for demonstrating the artists’ work.
Modeling in Game Production 5
Fig. 1.7: Two different representations of a sphere. (a) Implicit surface. (b)
Polygon mesh.
Fig. 1.8: Concave polygons are harder to process than convex ones and
therefore are rarely used.
polygon mesh shown in Fig. 1.7-(b). Real-time applications prefer the poly-
gon mesh representation because the GPU has been optimized for processing
the representation. Note that the mesh vertices are the points sampling the
smooth surface, and therefore the polygon mesh is not an accurate but an
approximate representation.
OpenGL supports a general polygon having an arbitrary number of vertices,
but the polygon must be convex. Fig. 1.8 compares convex and concave
polygons. The restriction on convexity is placed because the algorithm for
processing concave polygons is slow. Another restriction in OpenGL is that
the polygon must be planar, i.e., the vertices of a polygon must lie in the same
Fig. 1.10: Rendering a low-resolution mesh is fast but the model’s polygonal
nature is easily revealed. Rendering a high-resolution mesh is slow, but the
rendering result is better in general.
plane. The simplest polygon is a triangle, and it guarantees the convexity and
planarity. The polygons supported by Direct3D are limited to triangles, i.e.,
a polygon mesh in Direct3D implies a triangle mesh. Fig. 1.9 compares a
triangle mesh and a quadrilateral mesh (simply a quad mesh) for the same
object. The triangle mesh is more popular. However, the quad mesh is often
preferred, especially for modeling step, as can be observed in Section 1.2.1.
When we approximate a curved surface by a polygon mesh, various resolu-
tions can be considered, as shown in Fig. 1.10. There is a trade-off between
accuracy and efficiency. As the resolution is increased, the mesh becomes
closer to the original curved surface, but the time needed for processing the
mesh is increased. Handling various resolutions of a polygon mesh has been
an important research topic [4]. The process of converting a low-resolution
mesh into a high-resolution mesh is called refinement, and the reverse process
is called simplification.
2 Inthis book, the asterisk-marked parts can be skipped, and no difficulty will be encoun-
tered for further reading.
8 3D Graphics for Game Programming
Fig. 1.13: Indexed triangle list. Vertices are stored with no duplication in
the vertex buffer, and the index buffer stores the triangle information.
The indexed triangle list brings not only storage efficiency but also perfor-
mance increase. For rendering, a triangle mesh is sent to the GPU. As will be
presented in Chapter 2, each vertex of a mesh is independently transformed
by the so-called vertex processing stage of the GPU and is stored in a post-
transform cache. If a triangle references a vertex located in the cache, the
vertex is simply fetched from the cache instead of being transformed again
by the vertex processing stage. When searching the cache for the vertex
referenced by a triangle, the vertex index is used. (The triangle formed by
assembling three vertices of the cache is further processed for rendering.)
Only when the cache is missed, the vertex is processed. Therefore, the
average number of vertices processed per triangle is called the average cache
miss ratio (ACMR). It is often used to measure the rendering performance.
In a typical closed mesh, the number of triangles is approximately twice the
number of vertices, i.e., given n vertices, we have about 2n triangles. See note
in the next page for discussion on this ratio4 . If the post-transform cache is
large enough to contain all vertices of the mesh, no vertex will be processed
n
multiple times. Then, the ACMR will be approximately 2n , i.e., 0.5.
4 Note presented in a shaded box contains the background theory, technically detailed dis-
cussions, or advanced issues. If you are not interested, it can be skipped with no difficulty
in following the main stream of the book.
Modeling in Game Production 13
v−e+f =2 (1.1)
where v, e, and f are respectively the numbers of vertices, edges, and faces
of the mesh. In a closed triangle mesh, every edge is shared by two faces,
and every face has three edges. Therefore, if we count two faces per edge, the
counted number will be three times the number of faces of the mesh, i.e.,
2e = 3f (1.2)
The cache has a limited size. If the triangles are randomly ordered, the
cache may not be very helpful. See Fig. 1.14. In the first ordering, the
vertices of triangle 1 are processed and stored in the cache. Then, among the
three vertices of triangle 2, two are fetched from the cache, and only one is
processed. The same applies to triangle 3. It is less likely to process a vertex
multiple times. Consider the second ordering. Triangle 8 follows triangle 1,
and all of its vertices need to be processed. The same applies to triangle
11. When triangle 3 is processed, its vertex shared with triangle 1 might
have been replaced if the cache is quite small. Then, the vertex has to be
14 3D Graphics for Game Programming
Fig. 1.15: Triangle strip. Except for the first triangle, each triangle shares
two vertices with the previous triangle.
processed again. In the worst case, where three vertices referenced by each
triangle are not found in the cache, the ACMR will be 3. These examples
show that ACMR depends on the order of the triangles fed into the GPU.
The ACMR can be reduced if the triangles of a polygon mesh are ordered to
increase the locality of vertex reference. There have been efforts for reducing
ACMR by reordering the triangles [5, 6]. A few utilities are available, and an
example is ID3DXMesh::Optimize5 . With such an effort to provide a triangle
mesh with high locality, ACMR can be maintained between 0.5 and 1 in most
applications.
Fig. 1.16: Triangle normal. (a) The triangle is composed of three vertices,
p1 , p2 , and p3 . (b) The cross product v1 ×v2 is computed using the right-hand
rule and defines the triangle normal.
Consider the triangle hp1 ,p2 ,p3 i in Fig. 1.16-(a). Its normal is obtained by
taking the edges as vectors and calculating their cross product 6 . Let us denote
the vector connecting the first vertex (p1 ) and the second (p2 ) by v1 , as shown
in Fig. 1.16-(b). Similarly, the vector connecting the first vertex (p1 ) and the
third (p3 ) is denoted by v2 . Then, the triangle normal is computed as follows:
v1 × v2
(1.3)
||v1 × v2 ||
where × denotes the cross product operation. The cross product is divided by
its length to make a unit vector. In computer graphics, every normal vector
is made to be a unit vector by default.
Equation (1.3) follows the right-hand rule: The thumb of the right hand
indicates the direction of the cross product when the remaining fingers curl
from the first argument vector (v1 ) to the second (v2 ).
6 Consider two 3D vectors, a and b. When their coordinates are (ax , ay , az ) and (bx , by , bz ),
respectively, the cross product a × b is defined to be (ay bz − az by , az bx − ax bz , ax by − ay bx ).
The cross product is perpendicular to both a and b, i.e., perpendicular to the plane spanned
by a and b.
16 3D Graphics for Game Programming
Fig. 1.17: In the representation of indexed triangle list, the index buffer
records the vertices in the CCW order.
What if the vertices of the triangle are ordered as p1 , p3 , and p2 ? The first
vertex (p1 ) and the second (p3 ) are connected to generate v2 , and the first
(p1 ) and the third (p2 ) generate v1 . The right-hand rule applied to v2 and v1
defines the triangle normal as follows:
v2 × v1
(1.4)
||v2 × v1 ||
Note that Equations (1.3) and (1.4) represent opposite directions. The normal
direction depends on the vertex order, i.e., whether hp1 ,p2 ,p3 i or hp1 ,p3 ,p2 i.
Observe that, in Fig. 1.16-(a), hp1 ,p2 ,p3 i represents the counter-clockwise
(CCW) order of vertices whereas hp1 ,p3 ,p2 i represents the clockwise (CW)
order. According to the right-hand rule, the CCW order makes the normal
point out of the object whereas the CW order makes the normal inward. The
convention in computer graphics is to make the normal point outward. For
this purpose, the triangle vertices are always ordered CCW. Fig. 1.17 shows
an example of the indexed triangle list with the CCW vertex ordering.
We have so far discussed the triangle normals, but more important in com-
puter graphics are the vertex normals. The vertex normals might be less
intuitive than the triangle normals. Then, recall that the mesh vertices are
the points sampling the smooth surface, as illustrated in Fig. 1.18. A normal
can be assigned to a vertex such that the vertex normal approximates the
normal of the smooth surface at the sampled point.
Given a polygon mesh only, computing the vertex normals is an undercon-
strained problem, and rules of thumb and heuristics are often adopted [7]. A
simple method is to average the normals of all triangles sharing the vertex,
as shown in Fig. 1.19. In many cases, the vertex normals are automatically
computed by the modeling packages, stored as vertex attributes in the vertex
buffer, and then passed to the rendering step.
Modeling in Game Production 17
Fig. 1.18: A vertex normal corresponds to the surface normal at the point
sampled by the vertex.
vertices 530
49.2721 0.809525 85.6266 -0.966742 0.0 0.255752
48.5752 0.809525 88.2606 -0.966824 0.0 0.255444
49.3836 0.809525 89.1386 -0.092052 0.0 0.995754
...
faces 1024
0 5 6
6 1 0
1 6 7
...
In the above example, the exported polygon mesh is composed of 530 ver-
tices and 1024 triangles. A vertex is described by six floating-point values:
three for position and three for normal. The vertex index is implicitly spec-
ified such that the first vertex is 0, the second is 1, and so on. A triangle is
described by three indices. For example, the first triangle is composed of the
0th, 5th and 6th vertices.
Game-developing studios usually have their own proprietary data represen-
tations and exporters that are optimized for the games under development.
Modeling in Game Production 19
The exported polygon mesh is loaded into the run-time game program, also by
a proprietary importer. The polygon mesh represented in an indexed triangle
list is usually loaded into two CPU arrays: one for vertices and the other for
indices. A series of graphics API functions is invoked to pass the arrays to
GPU. Then, the GPU renders the polygon mesh.
of each triangle is changed such that the triangle normal points out of the
polyhedron. If the vertex order is hp1 , p2 , p3 i, the changed is hp1 , p3 , p2 i, as
shown in Fig. 1.20-(b).
Let us discuss another remodeling task. Fig. 1.21-(a) shows an object
composed of a triangle and a square. It is defined at the −z side of the RHS.
When a model is viewed, a synthetic camera’s position and view direction have
to be defined, as will be presented in Chapter 2. Assume that the camera is
positioned at the origin and its view direction is (0, 0, −1). Then, the camera
captures the image shown in the right-hand side of Fig. 1.21-(a).
Suppose that the object is ported as is into the LHS-based package. Shown
in the left of Fig. 1.21-(b) is the object placed in the LHS. Let us use the
same view parameters specified in the RHS-based package. Then, the resulting
image will be the one at the right of Fig. 1.21-(b), which is the reflection of
the image shown in Fig. 1.21-(a).
A solution to resolve this inconsistency is simple. At the remodeling stage,
the z -coordinates of the object and view parameters are negated. It has the
effect of reflecting the object and camera with respect to the xy-plane. Fig.
1.21-(c) shows the z -negated object and view parameters. Then, the correct
image is obtained.
Modeling in Game Production 21
Fig. 1.21: Reflection needed for converting from RHS to LHS. (a) An object
and the view parameters are defined in an RHS. (b) The object is imported
as is to an LHS. Note that the vertex coordinates are not changed. The
view parameters are also used without change. The captured image in the
LHS is different from the one captured in the RHS shown in (a). (c) The
z -coordinates of both the object and view parameters are negated. Then, the
image captured in the LHS is identical to the one shown in (a).
22 3D Graphics for Game Programming
Exercises
1. Consider the simplest 3D closed mesh, tetrahedron. Suppose that it
is composed of four vertices, (0,0,0), (1,0,0), (0,1,0), and (0,0,1). The
triangle normals should point out of the tetrahedron.
(a) Assuming that the tetrahedron is exported to a right-hand sys-
tem, draw the vertex and index buffers for its indexed triangle list
representation.
(b) Assuming that the tetrahedron is exported to a left-hand system,
do the same.
2. Let v, e, and f denote the numbers of vertices, edges and faces of a
closed triangle mesh, respectively. In [Note: Vertex-triangle ratio in a
triangle mesh], we have derived f = 2v − 4. Derive a similar relation
between v and e.
3. ATVR stands for average transform to vertex ratio, and measures the
number of vertex-transforms per vertex. (It is different from ACMR.)
Fig. 2.1: The vertex processing and fragment processing stages (in rounded
boxes) are programmable, and the rasterization and output merging stages
(in rectangles) are hard-wired.
The main component of the rendering pipeline consists of the stages for
vertex processing, rasterization, fragment processing, and output merging.
Fig. 2.1 uses a polygon of a 3D model to illustrate the process of filling
its interior that occurs during the four stages. The vertex processing stage
operates on every input vertex stored in the vertex buffer and performs various
operations such as transform. The rasterization stage assembles polygons from
the vertices and converts each polygon to a set of fragments. A fragment refers
to a set of data needed to update a pixel1 in the color buffer. (The color
buffer is a memory space storing the pixels to be displayed on the screen.)
The fragment processing stage operates on each fragment and determines its
1 InDirect3D, the word pixel is used for both fragment and pixel, but it often brings
confusion.
23
24 3D Graphics for Game Programming
Fig. 2.2: Transforms and spaces in the vertex processing stage. Sections
2.1, 2.2, and 2.4 present the three transforms in order.
where sx , sy and sz are the scaling factors along the principal axes. If all of
the scaling factors are identical, the scaling is called uniform. Otherwise, it is
a non-uniform scaling. A vector is scaled through matrix multiplication:
sx 0 0 x sx x
0 sy 0 y = sy y
0 0 sz z sz z
x0 = rcos(φ + θ)
= rcosφcosθ − rsinφsinθ (2.2)
= xcosθ − ysinθ
26 3D Graphics for Game Programming
y 0 = rsin(φ + θ)
= rcosφsinθ + rsinφcosθ (2.3)
= xsinθ + ycosθ
Equations (2.2) and (2.3) are combined into a matrix multiplication form:
0
x cosθ −sinθ x
= (2.4)
y0 sinθ cosθ y
z0 = z (2.5)
On the other hand, Equations (2.2) and (2.3) hold for the xy-coordinates.
Then, Equations (2.2), (2.3), and (2.5) are combined into a matrix multipli-
cation form: 0
x cosθ −sinθ 0 x
y 0 = sinθ cosθ 0 y (2.6)
z0 0 0 1 z
The 3×3 matrix in Equation (2.6) represents Rz .
In Equations (2.2), (2.3), and (2.5), let us apply cyclic permutation to the
xyz -coordinates, i.e., x, y, and z are replaced by y, z, and x, respectively.
Then, we obtain the rotation about the x -axis:
1 0 0
Rx = 0 cosθ −sinθ (2.7)
0 sinθ cosθ
Applying the cyclic permutation one more time leads to the rotation about
the y-axis:
cosθ 0 sinθ
Ry = 0 1 0 (2.8)
−sinθ 0 cosθ
000 1 1 1
Note that Equations (2.9) and (2.10) show the same result, one in Cartesian
coordinates and the other in homogeneous coordinates.
For handling the homogeneous coordinates, the 3×3 matrices for scaling
and rotation need to be altered. For example, the scaling matrix in Equation
(2.1) is extended into a 4×4 matrix and applied to a point in homogeneous
coordinates as follows:
sx 0 0 0 x sx x
0 sy 0 0 y sy y
0 0 sz 0 z = sz z
0 0 0 1 1 1
The fourth row of the 4×4 matrix is (0 0 0 1) and serves to copy the fourth
coordinate of the point into the transformed. In Section 2.4, however, you
will find a new class of transforms, whose fourth row is not (0 0 0 1).
In general, the fourth component of the homogeneous coordinates is not
necessarily 1 and is denoted by w. The homogeneous coordinates (x, y, z, w)
x y z
correspond to the Cartesian coordinates ( w , w , w ). For example, (1,2,3,1),
(2,4,6,2) and (3,6,9,3) are different homogeneous coordinates for the same
Cartesian coordinates (1,2,3). In other words, (x, y, z, 1) are just an instance
of the infinitely many homogeneous coordinates for the Cartesian coordinates
(x, y, z).
The w-component of the homogeneous coordinates is used to distinguish
between vectors and points. If w is 0, (x, y, z, w) represent a vector, not a
point.
Fig. 2.4: The sphere and teapot are defined in their own object spaces and
are assembled into a single space, the world space.
Given a sphere and a teapot created in their own object spaces, let us
construct the scene shown in Fig. 2.4. The world transform needed for the
sphere is simply a scaling. Suppose that the scaling factors are all 2s. Then,
we have the following scaling matrix:
2000
0 2 0 0
0 0 2 0
0001
Consider the north pole of the sphere located at (0,1,0) of the object space.
The world matrix transforms it into (0,2,0) in the world space:
2000 0 0
0 2 0 01 2
0 0 2 00 = 0
0001 1 1
The world transform needed for the teapot is a rotation about the y-axis
(Ry ) followed by a translation, as illustrated in Fig. 2.5. Ry is defined in Equa-
tion (2.8). The sign of the rotation angle θ is determined as follows: Look
at the origin of the coordinate system such that the axis of rotation points
toward you. If the rotation is counter-clockwise, θ is positive. If the rotation
is clockwise, θ is negative. (See [Note: Clockwise and counter-clockwise rota-
tions] for more on this.) In Fig. 2.5, the rotation angle is 90◦ , and we have
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of Paita
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.
Title: Paita
Translator: L. Onerva
Language: Finnish
Kirj.
Anatole France
L. Onerva
SISÄLLYS:
1. Kuningas Kristoffer, hänen hallituksensa, tapansa ja
sairautensa.
2. Tohtori Rodrigon parannuskeino.
3. Herrat Nelilehti ja Pyhä-Sylvanus etsivät onnellista miestä
kuninkaan palatsista.
4. Hieronymus.
5. Kuninkaallinen kirjasto.
6. Volmarin herttua.
7. Rikkauden suhde onneen.
8. Pääkaupungin salongit.
9. Onni olla rakastettu.
10. Onko onni siinä, että olemassaolon-tunto lakkaa.
11. Sigismundus Dux.
12. Onko pahekin avu.
13. Kirkkoherra Puolikinnas.
14. Onnellinen ihminen.
Anatole France
— Ah, hyvät herrat, näin juuri niin kaunista unta. Uneksuin, että
kuningas korotti Lehdonrauhan maat markiisikunnaksi. Voi, se oli
ainoastaan unelma ja minä tiedän liiankin hyvin, että kuninkaan
tarkoitusperät ovat aivan päinvastaiset.
— Mennään eteenpäin, sanoi Pyhä-Sylvanus. On myöhä, emmekä
saa hukata aikaa.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com