100% found this document useful (1 vote)
33 views

3D Graphics for Game Programming 1st Edition Junghyun Han 2024 scribd download

The document provides information on various ebooks related to 3D graphics and game programming, including titles by authors such as Junghyun Han and Maneesh Sethi. It includes links to download these ebooks and details about the contents, such as modeling, vertex processing, and illumination in game production. Additionally, it mentions the ISBN and publication details for the book '3D Graphics for Game Programming' by Junghyun Han.

Uploaded by

avenakorahmh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
33 views

3D Graphics for Game Programming 1st Edition Junghyun Han 2024 scribd download

The document provides information on various ebooks related to 3D graphics and game programming, including titles by authors such as Junghyun Han and Maneesh Sethi. It includes links to download these ebooks and details about the contents, such as modeling, vertex processing, and illumination in game production. Additionally, it mentions the ISBN and publication details for the book '3D Graphics for Game Programming' by Junghyun Han.

Uploaded by

avenakorahmh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

Visit https://ebookfinal.

com to download the full version and


explore more ebooks

3D Graphics for Game Programming 1st Edition


Junghyun Han

_____ Click the link below to download _____


https://ebookfinal.com/download/3d-graphics-for-game-
programming-1st-edition-junghyun-han/

Explore and download more ebooks at ebookfinal.com


Here are some suggested products you might be interested in.
Click the link to download

3D Game Programming for Teens Second Revised Edition


Maneesh Sethi

https://ebookfinal.com/download/3d-game-programming-for-teens-second-
revised-edition-maneesh-sethi/

Microsoft XNA Unleashed Graphics and Game Programming for


Xbox 360 and Windows 1st ed Edition Carter

https://ebookfinal.com/download/microsoft-xna-unleashed-graphics-and-
game-programming-for-xbox-360-and-windows-1st-ed-edition-carter/

Advanced 3D Game Programming with DirectX 9 Wordware Game


Developer s Library 600th Edition Peter Walsh

https://ebookfinal.com/download/advanced-3d-game-programming-with-
directx-9-wordware-game-developer-s-library-600th-edition-peter-walsh/

Introduction to 3D game programming with DirectX 10 1st


Edition Frank D. Luna

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/

Symbolic Dynamics and Geometry Using D in Graphics and


Game Programming 1st Edition Brian Guenter (Author)

https://ebookfinal.com/download/symbolic-dynamics-and-geometry-using-
d-in-graphics-and-game-programming-1st-edition-brian-guenter-author/

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/

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/

LÖVE for Lua Game Programming 1st Edition Akinlaja

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

Boca Raton London New York

CRC Press is an imprint of the


Taylor & Francis Group, an informa business
A CHAPMAN & HALL BOOK
The cover image of green and yellow barley is titled “When Barley is Ripening” and is by artist Lee
Sook Ja.

Chapman & Hall/CRC


Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2011 by Taylor and Francis Group, LLC
Chapman & Hall/CRC is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works

Printed in the United States of America on acid-free paper


10 9 8 7 6 5 4 3 2 1

International Standard Book Number-13: 978-1-4398-2738-3 (Ebook-PDF)

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

To my pride and joy, Jeehee, who is stepping into a new world.

i
Contents

Preface ix

1 Modeling in Game Production 1


1.1 Game Production Pipeline . . . . . . . . . . . . . . . . . . . 1
1.2 Polygon Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 Polygon Mesh Creation∗ . . . . . . . . . . . . . . . . . 7
1.2.2 Polygon Mesh Representation . . . . . . . . . . . . . . 11
1.2.3 Surface Normal . . . . . . . . . . . . . . . . . . . . . . 15
1.3 Model Export and Import . . . . . . . . . . . . . . . . . . . 17
1.4 Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . 19

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

3.7.1 Computing World-space Ray . . . . . . . . . . . . . . 76


3.7.2 Ray-object Intersection Test . . . . . . . . . . . . . . . 81

4 Fragment Processing and Output Merging 89


4.1 Texturing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.1.1 Texture Coordinates . . . . . . . . . . . . . . . . . . . 89
4.1.2 Surface Parameterization . . . . . . . . . . . . . . . . 92
4.1.3 Texture Coordinates to Texel Address . . . . . . . . . 94
4.2 Output Merging . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.2.1 Z-buffering . . . . . . . . . . . . . . . . . . . . . . . . 95
4.2.2 Alpha Blending . . . . . . . . . . . . . . . . . . . . . . 97
4.3 Z-culling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.3.1 Tile-based Culling . . . . . . . . . . . . . . . . . . . . 99
4.3.2 Application: Pre-Z Pass . . . . . . . . . . . . . . . . . 101

5 Illumination and Shaders 105


5.1 Phong Lighting Model . . . . . . . . . . . . . . . . . . . . . . 105
5.1.1 Diffuse Reflection . . . . . . . . . . . . . . . . . . . . . 107
5.1.2 Specular Reflection . . . . . . . . . . . . . . . . . . . . 108
5.1.3 Ambient Reflection . . . . . . . . . . . . . . . . . . . . 111
5.1.4 Emissive Light . . . . . . . . . . . . . . . . . . . . . . 111
5.2 Shaders and Shading Languages . . . . . . . . . . . . . . . . 112
5.2.1 Vertex and Fragment Shaders . . . . . . . . . . . . . . 112
5.2.2 High-Level Shading Language∗ . . . . . . . . . . . . . 113
5.3 Lighting in the Pipeline . . . . . . . . . . . . . . . . . . . . . 115
5.3.1 Per-vertex Lighting in HLSL∗ . . . . . . . . . . . . . . 115
5.3.2 Per-vertex Lighting vs. Per-fragment Lighting . . . . . 117
5.3.3 Per-fragment Lighting in HLSL∗ . . . . . . . . . . . . 120
5.4 Global Illumination . . . . . . . . . . . . . . . . . . . . . . . 121
5.4.1 Ray Tracing . . . . . . . . . . . . . . . . . . . . . . . . 122
5.4.2 Radiosity . . . . . . . . . . . . . . . . . . . . . . . . . 125

6 Parametric Curves and Surfaces 131


6.1 Parametric Curves . . . . . . . . . . . . . . . . . . . . . . . . 131
6.1.1 Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . 132
6.1.2 Hermite Curve and Catmull-Rom Spline . . . . . . . . 136
6.2 Application: Camera Path . . . . . . . . . . . . . . . . . . . 138
6.3 Bézier Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . 141
6.3.1 Bilinear Patch . . . . . . . . . . . . . . . . . . . . . . 141
6.3.2 Biquadratic Bézier Patch . . . . . . . . . . . . . . . . 144
6.3.3 Bicubic Bézier Patch . . . . . . . . . . . . . . . . . . . 148
6.3.4 Bézier Triangle . . . . . . . . . . . . . . . . . . . . . . 151
vii

7 Shader Models 157


7.1 Shader Model 4 and Geometry Shader . . . . . . . . . . . . . 157
7.2 Application: Dynamic Particle System . . . . . . . . . . . . 159
7.2.1 Physics-based Simulation of Particles . . . . . . . . . . 159
7.2.2 Fireworks Simulation . . . . . . . . . . . . . . . . . . . 162
7.2.3 Fireworks Rendering . . . . . . . . . . . . . . . . . . . 164
7.3 Shader Model 5 and Tessellation . . . . . . . . . . . . . . . . 166
7.4 Application: PN-triangles . . . . . . . . . . . . . . . . . . . . 167
7.4.1 Computing Control Points . . . . . . . . . . . . . . . . 168
7.4.2 Computing Control Normals . . . . . . . . . . . . . . 171
7.4.3 PN-triangle Tessellation . . . . . . . . . . . . . . . . . 174

8 Image Texturing 177


8.1 Texture Addressing Mode . . . . . . . . . . . . . . . . . . . . 177
8.2 Texture Filtering . . . . . . . . . . . . . . . . . . . . . . . . . 180
8.2.1 Magnification . . . . . . . . . . . . . . . . . . . . . . . 180
8.2.2 Minification . . . . . . . . . . . . . . . . . . . . . . . . 182
8.3 Mipmapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
8.3.1 Mipmap Construction . . . . . . . . . . . . . . . . . . 184
8.3.2 Mipmap Filtering . . . . . . . . . . . . . . . . . . . . . 184
8.3.3 Options for Mipmap Filtering . . . . . . . . . . . . . . 187
8.4 Anisotropic Filtering . . . . . . . . . . . . . . . . . . . . . . 190

9 Bump Mapping 197


9.1 Height Field . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.2 Normal Mapping . . . . . . . . . . . . . . . . . . . . . . . . . 199
9.2.1 Normal Map . . . . . . . . . . . . . . . . . . . . . . . 200
9.2.2 Algorithm for Normal Mapping . . . . . . . . . . . . . 202
9.3 Tangent-space Normal Mapping . . . . . . . . . . . . . . . . 206
9.3.1 Algorithm for Tangent-space Normal Mapping . . . . 206
9.3.2 Tangent Space Computation∗ . . . . . . . . . . . . . . 210
9.4 Authoring of Normal Map . . . . . . . . . . . . . . . . . . . 212
9.5 Parallax Mapping . . . . . . . . . . . . . . . . . . . . . . . . 215
9.6 Displacement Mapping . . . . . . . . . . . . . . . . . . . . . 219

10 Advanced Texturing 225


10.1 Environment Mapping . . . . . . . . . . . . . . . . . . . . . . 225
10.1.1 Cube Mapping . . . . . . . . . . . . . . . . . . . . . . 226
10.1.2 Cube Map Access∗ . . . . . . . . . . . . . . . . . . . . 227
10.1.3 Dynamic Cube Mapping . . . . . . . . . . . . . . . . . 229
10.2 Light Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . 230
10.2.1 Diffuse Light Mapping . . . . . . . . . . . . . . . . . . 231
10.2.2 Radiosity Normal Mapping∗ . . . . . . . . . . . . . . . 232
10.3 Shadow Mapping . . . . . . . . . . . . . . . . . . . . . . . . 236
10.3.1 Algorithm for Shadow Mapping . . . . . . . . . . . . . 237
viii

10.3.2 Shader Codes for Shadow Mapping∗ . . . . . . . . . . 242


10.3.3 Shadow Map Filtering . . . . . . . . . . . . . . . . . . 245
10.4 Ambient Occlusion . . . . . . . . . . . . . . . . . . . . . . . 248
10.5 Deferred Shading . . . . . . . . . . . . . . . . . . . . . . . . 253

11 Character Animation 257


11.1 Keyframe Animation . . . . . . . . . . . . . . . . . . . . . . 257
11.2 Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
11.2.1 Interpolation of Euler Angles . . . . . . . . . . . . . . 261
11.2.2 Quaternion Representation . . . . . . . . . . . . . . . 262
11.2.3 Rotation Using Quaternion . . . . . . . . . . . . . . . 263
11.2.4 Interpolation of Quaternions . . . . . . . . . . . . . . 267
11.3 Hierarchical Modeling and Space Change . . . . . . . . . . . 269
11.3.1 Hierarchical Model . . . . . . . . . . . . . . . . . . . . 270
11.3.2 Space Change between Bones . . . . . . . . . . . . . . 272
11.3.3 World Space to Bone Space . . . . . . . . . . . . . . . 274
11.4 Forward Kinematics . . . . . . . . . . . . . . . . . . . . . . . 278
11.5 Skinning and Keyframe Animation . . . . . . . . . . . . . . . 280
11.5.1 Skinning . . . . . . . . . . . . . . . . . . . . . . . . . . 280
11.5.2 Skinning in Keyframe Animation . . . . . . . . . . . . 283
11.6 Inverse Kinematics . . . . . . . . . . . . . . . . . . . . . . . . 286
11.6.1 Analytic Solution . . . . . . . . . . . . . . . . . . . . . 286
11.6.2 Cyclic Coordinate Descent . . . . . . . . . . . . . . . . 288

12 Physics-based Simulation∗ 293


12.1 Penalty Method . . . . . . . . . . . . . . . . . . . . . . . . . 293
12.2 Impulse Method . . . . . . . . . . . . . . . . . . . . . . . . . 296
12.2.1 Impulse . . . . . . . . . . . . . . . . . . . . . . . . . . 296
12.2.2 Impulse-based Collision Resolution . . . . . . . . . . . 297
12.3 Collision Detection . . . . . . . . . . . . . . . . . . . . . . . 301
12.3.1 Bounding Volumes and Their Hierarchy . . . . . . . . 303
12.3.2 Triangle-triangle Intersection . . . . . . . . . . . . . . 306

References 311
Preface

Many of computer graphics classes in colleges are focused on real-time render-


ing and animation. However, it is not easy to find an appropriate textbook,
which presents the state of the art in interactive graphics, is balanced between
theory and practicality, and is of a proper length to be covered in a semester.
This book is written for answering the need and presents the must-know in
interactive graphics. This book fits the advanced undergraduate or beginning
graduate classes for ‘Computer Graphics’ and ‘Game Programming.’
Another primary reader group of this book may be composed of game de-
velopers, who have experience in graphics APIs and shader programming but
have felt lack of theoretical background in 3D graphics. A lot of programming
manual-like books can be found in the bookstore, but they do not provide a
sufficient level of mathematical background for the game developers. Assum-
ing that the readers have minimal understanding of vectors and matrices, this
book provides an opportunity to combine their experiences with the back-
ground theory of computer graphics.
At the core of contemporary interactive graphics is the evolution of GPU.
The content of this book is organized around GPU programming. The GPU
is partitioned into programmable stages and hard-wired stages. This book
presents a variety of algorithms for the programmable stages, and the indis-
pensable knowledge required to configure the hard-wired stages.
The organization and presentation of this book have been carefully designed
so as to enable the readers to easily understand the key aspects of interac-
tive graphics. Over the chapters, a lot of 3D presentations are provided in
order to help the readers quickly grasp the complicated topics. An impor-
tant organizational feature of this book is that theoretical or technical details
are presented in separate notes (in shaded boxes) and in optional sections
(marked by asterisk). They can be safely skipped without any difficulty in
understanding the main stream of the book.
Two well-known graphics APIs are Direct3D and OpenGL. This book is
API-neutral but presents the sample programs bit by bit in many places.
They help the readers understand how the interactive graphics algorithms are
implemented. However, the sample programs are located at the optional part
and can be safely skipped.
If the optional parts are not taught, the content of this book would be
appropriate for being covered in a semester for the undergraduate class. If
needed, additional choices may be made among the required parts. For ex-
ample, Sections 6.3 and 7.4 may be skipped.

ix
x

A Web site is provided for this book, http://media.korea.ac.kr/book, which


contains full lecture notes in PowerPoint files and additional materials includ-
ing video clips. Especially, the lecture notes contain all figures presented in
this book.

Acknowledgements

This book is a byproduct of a project supported by Nexon Corporation


and Korea Creative Content Agency. Many people from Nexon contributed
to the content of this book. Jubok Kim has worked together with the author
from the proposal stage of this book, and also proofread the alpha and beta
versions. Seungwon Han provided the key 3D models used in this book and
performed various art works requested by the author. Hyunwoo Ki, Joongwon
Gouk, and Minsun Song also provided valuable images.
Many people from Korea University supported writing this book. Virtu-
ally all visual presentations given in this book are generated by Seungjik Lee,
who has an exceptional talent in both programming and visual art. Without
the dedicated efforts of Dr. Nguyen Trung Kien, three chapters on texturing
could never be completed. Dr. Hanyoung Jang has made great contributions
to the chapters on shader models and physics-based simulation. Kiwon Um
helped the author keep reorganizing the chapters. The author has been deeply
indebted to his students at the 3D Interactive Media Lab: Dong-young Kim,
Hyun Ju Shin, YoungBeom Kim, EunSeok Han, GwangHyun Park, Seungho
Baek, and Junhoo Park. The content of this book has been gradually built
through the courses offered at Korea University and Carnegie Mellon Uni-
versity. The students in the classes have provided the author with a lot of
feedback.
Prof. Young J. Kim at Ewha Womans University, Prof. Kyoung-Su Oh at
Soongsil University, Prof. Kang Hoon Lee at Kwangwoon University, Prof.
Jorg Peters at the University of Florida, and Dongwook Ha at Crytek reviewed
the draft of this book and provided invaluable comments. Li-Ming Leong, the
acquisitions editor of CRC Press, proposed this book, and since then has
considerately supported the author not to miss the planned dates.
The greatest thanks go to the brightest faces I have met in my life, Kyung-
Ok, Jeehee, and Jihoon. Thank you for always being with me. I love you so
much.
Chapter 1
Modeling in Game Production

The process of game development is typically partitioned into three stages:


pre-production, production, and post-production. The specific steps of each
stage may vary from game genre to genre and also from studio to studio.
In general, the pre-production stage includes sketching the game characters,
composing the storyline, creating the storyboards (visual representations of
the storyline), and writing the design document. The game design document
is the blueprint from which a game is to be built, and states what the goals and
rules of the game are, how the maps and levels are defined, how the characters
and objects are controlled, and how the screen and menus are organized.
In the production stage, a crew of level designers1 , artists, programmers,
and sound engineers is made up. They cooperate under the supervision of
producers. The design document is usually updated during the production
stage. For example, levels can be added or removed. The output of the pro-
duction stage is a game program and a bunch of game assets to be consumed
by the game program. The assets include 3D models, images, and animation
data.
The final stage is post-production. The output of the production stage is
passed to the game testers. The flaws and bugs are reported, and then the
programmers and artists fix them. This process is iterated, and the game
evolves into the final version.
This book is about the 3D graphics aspect of the production stage. The
first step of the 3D game production stage is modeling. This chapter presents
the topics in modeling.

1.1 Game Production Pipeline


Compared with the pre- and post-production stages, the production stage
for 3D games has rather universal steps. They compose the game production

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.1: Three major steps of the game production pipeline.

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.

Fig. 1.6: Results of rendering the animated scenes.

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

Computer games generate an illusion of movement on the screen by quickly


displaying a sequence of changing images, called frames. When replaying an
object’s animation created by artists, distinct shape and pose (position and
orientation) of the object are computed per frame. In addition, run-time dy-
namics caused by external forces and collisions among the game objects is
handled, and the states of the involved objects are updated per frame. (This
process is referred to as physics-based simulation and is presented in Chap-
ter 12.) Furthermore, lighting conditions and viewing specifications can be
changed per frame. When all such parameters are determined, the rendering
module is invoked. Rendering is the process of generating a 2D image from
a 3D scene. The image makes up a frame. Fig. 1.6 shows the results of
rendering the animated scenes.
Unlike modeling and off-line animation conducted by artists, run-time an-
imation and rendering are executed by a game program. It is typically built
upon graphics APIs (Application Programming Interfaces) such as Direct3D
[1] and OpenGL (Open Graphics Library) [2]. Direct3D is part of Microsoft’s
DirectX API and is available only for Microsoft platforms. OpenGL is man-
aged by a non-profit consortium, the Khronos Group, and is a cross-platform
standard API.
Graphics APIs provide application programmers with essential graphics
functions. Today, such functions are implemented in hardware, named GPU
(Graphics Processing Unit), which is a processor specialized for graphics. A
graphics API can be taken as a software interface of the GPU. The API
translates the application’s graphics command to instructions that can be
executed by the GPU.
This book is not intended to be a manual for Direct3D or OpenGL, but
presents the sample programs bit by bit. They help the readers understand
how the real-time graphics algorithms are implemented. For programming
with the APIs, their SDK manuals should be referenced. For example, Di-
rect3D SDK [3] provides tutorials and samples for beginners.

1.2 Polygon Mesh


In 3D computer graphics, various modeling techniques are used. Consider a
sphere of radius r that is centered at (Cx , Cy , Cz ). Its simplest representation
is to use the sphere equation. See Fig. 1.7-(a). It is an example of an implicit
surface based on an implicit function f (x, y, z) = 0. Suppose that, when a
point (x, y, z) is inserted into the implicit function, the result is zero. Then,
the point is on the implicit surface.
We can represent the sphere explicitly in terms of its topological entities
such as vertices. A good example of such an explicit representation is the
6 3D Graphics for Game Programming

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.9: Triangle mesh vs. quadrilateral mesh.


Modeling in Game Production 7

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.

1.2.1 Polygon Mesh Creation∗


In most cases, the polygon mesh of a game object is interactively created
using graphics packages. The polygon mesh is stored in a file and is then
input to the game program which animates and renders it at run time. A
programmer may not have to understand how a polygon mesh is created. It
is the job of an artist. If you want, you can skip this subsection2 . However,
understanding the basics of the modeling step is often helpful for developing a
game as well as communicating with an artist. This section roughly sketches
how a polygon mesh of a character is created.

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.11: A polygon mesh is created by manual operations.


Modeling in Game Production 9

Fig. 1.11: A polygon mesh is created by manual operations (continued).


10 3D Graphics for Game Programming

Fig. 1.11: A polygon mesh is created by manual operations (continued).

In general, modeling packages provide the artist with various operations


such as selection, translation, rotation, and scaling for manipulating the topo-
logical entities of a polygon mesh, i.e., vertices, edges, and faces. Further, such
topological entities can be cut, extruded, and connected. Consider modeling
a character’s head. There are many ways of creating its polygon mesh, and
we choose starting from a box and modifying its topology and geometry.
Fig. 1.11 shows the step-by-step process of editing a box mesh to generate
a character’s head. In Fig. 1.11-(a), edges are selected and connected to refine
the coarse mesh of the box, i.e., to produce a larger number of smaller poly-
gons. Consequently, the topology is changed. In Fig. 1.11-(b), the vertices
of the refined mesh are selected and moved to change the mesh geometry. In
Fig. 1.11-(c), a polygon is selected and cut out to make a hole for an eye, and
then the mesh keeps being refined. Fig. 1.11-(d) shows that, for creating a
symmetric object, one side of the mesh is copied, reflected, and pasted to the
other side. In the modeling process, refining one side and copying the refined
to the other side are often repeated to create a well-balanced object.
Note that, in Fig. 1.11-(d), the right- and left-hand sides of the head are
separate meshes. However, they share the boundaries, and there are one-to-
one correspondences between their vertices. Fig. 1.11-(e) shows that a pair of
vertices at a single position can be combined into a vertex through a welding
operation. Then, two adjacent meshes are combined into a single mesh. Fig.
1.11-(f) shows that the neck of the mesh is extruded, and Fig. 1.11-(g) shows
the result. The mesh is further refined to add hair, as shown in Fig. 1.11-
(h). A complete character can be created by continuing such operations. Fig.
1.11-(i) shows the bust of the textured mesh.
Note that the model in Fig. 1.11 is a quad mesh, not a triangle mesh. The
quad mesh makes various operations easy. However, the modeling packages
provide a triangle mesh of the same object, and therefore we can use it for
rendering.
Modeling in Game Production 11

1.2.2 Polygon Mesh Representation

Fig. 1.12: Non-indexed triangle list. For a mesh of n triangles, 3n vertices


are stored in the vertex buffer.

Fig. 1.13: Indexed triangle list. Vertices are stored with no duplication in
the vertex buffer, and the index buffer stores the triangle information.

An obvious method to represent a triangle mesh is to enumerate its vertices,


where three vertices are read in linear order to make up a triangle. See the
2D triangles in Fig. 1.12. The vertices are stored in a memory space, named
vertex buffer 3 , and define three triangles. This representation is called a
triangle list.

3 Vertex buffer is the terminology of Direct3D. OpenGL calls it vertex array.


12 3D Graphics for Game Programming

The triangle list representation is quite intuitive. However, it is inefficient


because the vertex buffer contains redundant data. In Fig. 1.12, for example,
the vertex at (1,1) is shared by three triangles and appears three times in the
vertex buffer.
In a triangle mesh, a vertex is almost always shared by multiple triangles.
Then, the vertex buffer can be made compact by using a separate index buffer .
The vertices are stored in the vertex buffer with no duplication, and three
indices per triangle are stored in the index buffer. Fig. 1.13 shows the vertex
and index buffers for the same mesh of Fig. 1.12. This representation is called
indexed triangle list.
In general, the vertex data stored in the vertex buffer include not only
positions but also normals, texture coordinates, and many more. (All of
these data will be presented throughout this book.) Therefore, the vertex
buffer storage saved by removing the duplicate data outweighs the additional
storage needed for the index buffer. The representation illustrated in Fig.
1.12 is often called non-indexed, and it is rarely used because there are very
few cases where the indices are not needed.
In Direct3D, the formats for index buffer data are either 16- or 32-bit un-
signed integers. If 16-bit index is used, we can represent 216 (65,536) vertices.
With 32-bit index, 232 (4,294,967,296) vertices can be represented. When
fewer than 65,536 vertices are put into the vertex buffer, 16-bit format is
preferred because it results in a smaller index buffer.

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

[Note: Vertex-triangle ratio in a triangle mesh]


For a closed mesh with no hole, the Euler’s polyhedron formula asserts

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)

(As an example, consider a tetrahedron, where e is 6 and f is 4.) When we


replace e in Equation (1.1) by 23 f derived from Equation (1.2), we obtain the
following:
f = 2v − 4
As the mesh size increases, the number of faces (f ) converges to twice the
number of vertices (v).

Fig. 1.14: Triangle orders influence the rendering performance.

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.

Another interesting representation of a polygon mesh is a triangle strip. It


describes a mesh as a series of adjacent triangles. See Fig. 1.15. The first
triangle (t1 ) is rendered by processing the first three vertices in the vertex
buffer. When rendering the second triangle (t2 ), the last two vertices of the
first triangle, (0,0) and (1,1) in the example, are simply fetched from the
cache. Then, only a single vertex, (1,0) in the example, is taken from the
vertex buffer and processed. Similarly, the third triangle (t3 ) is rendered by
fetching two vertices, (1,1) and (1,0), from the cache, and processing a new
vertex, (2,1).
Let us consider the rendering performance of the triangle strip. In the ideal
case, three vertices are processed for the first triangle, and then a single vertex
is processed for each of the remaining triangles. Then, rendering n triangles
requires (n+2) vertices to be processed, i.e., ACMR is n+2 n . As n increases,
the ACMR approaches 1, which is usually worse than that of the indexed
triangle list. However, the triangle strip outperforms the triangle list for some
specific applications. For example, displaying a quadrilateral of four vertices
can be performed best by using the triangle strip with no index buffer.

5 D3DX is a library of utilities designed to provide additional graphics functionality on top


of Direct3D. ID3DXMesh is an interface of D3DX, and Optimize is a method of ID3DXMesh.
Modeling in Game Production 15

1.2.3 Surface Normal


In the real world, light emitted from a light source is reflected by object
surfaces and then reaches our eye. Such an interaction between light sources
and object surfaces is simulated in computer graphics. It is called lighting
and is essential for creating a photorealistic image of 3D models. In light-
ing, surface normal plays a key role, as is the case in the real-world physics.
(Lighting will be presented in Chapter 5.)

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.

Fig. 1.19: A vertex normal is often computed as a mean of the normals of


the triangles sharing the vertex.

1.3 Model Export and Import


As discussed earlier in this chapter, game objects and animation data cre-
ated using off-line graphics packages are stored in files and passed to the
run-time game program. The process of outputting the data in a format suit-
able for other applications is called export. On the other hand, taking such
exported data is called import.
Export can be done using plug-ins or scripts. A plug-in is referred to as an
add-on program that is designed for a specific application. It interacts with
the host program (for example, 3ds Max in the current context) to provide a
set of functions not supported by the host. A plug-in is coded in high-level
languages such as C and using the APIs provided by the host program. It is
compiled into a machine code and then run by CPU.
In contrast, a script is usually interpreted and run by the host program.
Many graphics packages provide their own script languages to manipulate
and output the data created by the packages. The script language of 3ds Max
18 3D Graphics for Game Programming

is MAXScript. In general, a script is less versatile than a plug-in because


a script language is domain-specific. A script is interpreted for execution
and consequently is slower than a plug-in that performs the same function.
Despite these drawbacks, a script is preferred in many applications because it
is easy to code and often provides an optimized access to the data of the host
program. Shown below are the pseudo script code that exports an indexed
triangle list and a fraction of the output text file.

Specify Out as the output file


foreach polygon mesh
Write the number of vertices to Out
foreach vertex
Write its position and normal to Out
endforeach
Write the number of polygons to Out
foreach polygon
Write its vertex indices to Out
endforeach
endforeach

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.

[Note: Vertex/index buffers and drawcall in Direct3D]


In Direct3D 9, IDirect3DDevice9 interface is the software controller of the
graphics device hardware. Through its methods, application programs in-
struct the GPU to create resources such as buffers and textures, draw 3D ge-
ometry, work with system-level variables, etc. For creating a vertex buffer and
an index buffer within the GPU, IDirect3DDevice9::CreateVertexBuffer
and IDirect3DDevice9::CreateIndexBuffer are invoked, respectively. The
vertex/index data stored in the CPU arrays may then be copied to
the vertex/index buffers using memcpy, for example. Finally, the poly-
gon mesh represented in the vertex/index buffers is drawn by invoking
IDirect3DDevice9::DrawIndexedPrimitive. It is called the drawcall for
the indexed triangle list. The drawcall for the non-indexed triangle list is
IDirect3DDevice9::DrawPrimitive. (Not only triangles but also line seg-
ments and points can be rendered as independent entities. They are collec-
tively called primitives.)

1.4 Coordinate Systems


The Cartesian coordinate system can be either right-handed or left-handed.
See Fig. 1.20-(a). In the right-hand system (RHS), the thumb of the right
hand points toward the positive end of the z -axis when the other four fingers
curl from the x -axis to the y-axis. In the left-hand system (LHS), the same
rule is applied to the left hand.
In Section 1.2.3, we implicitly assumed RHS and used the right hand for
defining the triangle normal. In LHS, however, the triangle normal is defined
using the left hand, i.e., the triangle vertices are traversed by the left hand’s
four fingers, making the thumb indicate the direction of the triangle normal.
Recall that, in Section 1.2.3, the triangle vertices were made to be ordered
counter-clockwise (CCW). It was also based on the assumption of RHS. If
we maintained the CCW vertex order in LHS, the triangle normal would
point inward. It violates the convention of computer graphics. Therefore, the
triangle vertices are ordered clockwise (CW) in LHS.
When a polygon mesh created in an RHS-based package is ported to an
LHS-based one, a sort of remodeling is needed. First of all, the vertex order
20 3D Graphics for Game Programming

Fig. 1.20: The handedness of a coordinate system determines the vertex


order of each triangle. (a) RHS vs. LHS. (b) CCW ordering for RHS vs. CW
ordering for LHS.

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

In summary, porting an application between RHS and LHS requires two


tasks: vertex order change and z -negation. Whereas the z -negation is re-
quired, the vertex order change is optional. There exists a roundabout way.
These issues will be presented more rigorously in Chapter 3.
OpenGL and Direct3D adopt different handedness. The default coordinate
system of OpenGL is right-handed whereas that of Direct3D is left-handed.
The difference constructed a barrier hard to cross over for inexperienced pro-
grammers. However, the barrier has crumbled away, and we can run an RHS-
based application on top of Direct3D, for example. It has been due to GPU’s
programmability, which will be presented in the next chapters.
This book uses RHS by default because it is much more familiar to the
ordinary readers. Therefore, the triangle vertices are listed in the CCW order
unless specified otherwise.

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

(a) What would be the best-case ATVR?


(b) What would be the worst-case ATVR?
Chapter 2
Vertex Processing

In computer architecture, a pipeline refers to a sequence of data processing


elements, where the output of one element is used as the input of the next
one. The rendering pipeline of GPU accepts a representation of a 3D scene
as input, which is mainly composed of polygons. The pipeline transforms a
stream of polygons to the 2D form. The colors of the pixels comprising the
2D polygons are computed, and finally the image of the scene is output.

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

color through various operations such as texturing. In the output merging


stage, the fragment competes or combines with the pixel in the color buffer
to update the pixel’s color.
The rendering pipeline architecture has continuously evolved. (Chapter 7
presents the state of the art.) Despite the evolution, the above four stages com-
pose the main component of the pipeline. The stages are either programmable
or fixed . The vertex and fragment processing stages are programmable. The
programs for the stages are called vertex program and fragment program. Us-
ing the programs, you can apply any transform you want to the vertex, and
you can determine the fragment color through any way you want.
In contrast, the rasterization and output merging stages are fixed or hard-
wired. They are not programmable but are just configurable through user-
defined parameters. Throughout this book, you will learn how to write the
vertex and fragment programs and how to configure the rasterization and
output merging stages.
This chapter covers the vertex processing stage, and Chapters 3 and 4
cover the remaining stages. Typical operations on a vertex include transform,
lighting, and animation. This chapter focuses on vertex transform and briefly
shows how a vertex can be lit. Chapter 5 gives a detailed discussion on vertex
lighting, and Chapter 11 presents how vertices can be animated.

2.1 World Transform

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.

Chapter 1 presented how a 3D model is created. The coordinate system


used for creating the model is named object space, which is also called model
space or local space. (Throughout this book, we use the terms space and
coordinate system interchangeably.) In the vertex processing stage, the object-
space model goes though several spaces and finally arrives at the clip space,
as illustrated in Fig. 2.2.
Vertex Processing 25

2.1.1 Affine Transforms and Homogeneous Coordinates


The world and view transforms in Fig. 2.2 are built upon the very basic
transforms, such as scaling, rotation, and translation. Scaling and rotation
are instances of a specific class of functions named linear transform. A com-
bination of linear transform and translation is called affine transform.
Three-dimensional scaling is represented by a 3×3 matrix:
 
sx 0 0
 0 sy 0  (2.1)
0 0 sz

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

Fig. 2.3: A vector p is rotated by θ to define a new vector p0 .

Now consider rotating a vector. Fig. 2.3 illustrates 2D rotation, where p is


rotated about the origin by θ to define p0 . If p’s length is r, the coordinates
of p are defined as follows:
x = rcosφ
y = rsinφ
The length of p0 is also r, and its x -coordinate is computed as follows:

x0 = rcos(φ + θ)
= rcosφcosθ − rsinφsinθ (2.2)
= xcosθ − ysinθ
26 3D Graphics for Game Programming

Its y-coordinate is similarly computed:

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

The 2×2 matrix in Equation (2.4) represents the 2D rotation matrix.


A 3D rotation requires the axis of rotation. First, consider rotation about
the z -axis, which we denote by Rz . Suppose that it rotates (x, y, z) into
(x0 , y 0 , z 0 ). Obviously, the z -coordinates are not changed by Rz :

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θ

Another frequently used transform in computer graphics is translation,


which displaces (x, y, z) to (x + dx , y + dy , z + dz ). Translation does not
fall into the class of linear transforms and is represented as vector addition:
     
x dx x + dx
 y  +  dy  =  y + dy  (2.9)
z dz z + dz
Vertex Processing 27

Fortunately, we can describe translation as matrix multiplication if we use


the homogeneous coordinates. Given the 3D Cartesian coordinates (x, y, z) of
a point, we can simply take (x, y, z, 1) as its homogeneous coordinates. Then,
translation is represented by a 4×4 matrix and is applied to the homogeneous
coordinates of the point through matrix multiplication:
    
1 0 0 dx x x + dx
 0 1 0 dy   y   y + dy 
 0 0 1 dz   z  =  z + dz  (2.10)
    

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.

2.1.2 World Matrix


Once an object is modeled, it can be thought of as being stuck to its object
space. Each vertex of the object is fixed and immovable in the object space.
The object space for a model is typically unrelated to that of another model.
The first task in the rendering pipeline is to assemble all the component
models defined in their own object spaces into a single space named world
space, which is the coordinate system used for the entire game environment.
This is performed by world transform.
28 3D Graphics for Game Programming

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 01 2
0 0 2 00 = 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

Author: Anatole France

Translator: L. Onerva

Release date: March 19, 2024 [eBook #73202]

Language: Finnish

Original publication: Hämeenlinnassa: Arvi A. Karisto, 1915

Credits: Juhani Kärkkäinen and Tapio Riikonen

*** START OF THE PROJECT GUTENBERG EBOOK PAITA ***


PAITA

Kirj.

Anatole France

43. ranskalaisesta painoksesta suomentanut

L. Onerva

Hämeenlinnassa, Arvi A. Karisto, 1915.

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

Anatole France (synt. 1844) on nykyisen Ranskan huomatuimpia


nimiä henkisen elämän alalla — kaunokirjailijana suuri tyylimestari ja
ajattelijana terävä elämänkysymysten seuloja. Hänen kirjallisen
työskentelynsä johtavana aatteena on inhimillisen tiedon ja
sivistyskehityksen kiitellyn oivallisuuden epäily, ja onpa hän toiselta
puolen myös asettunut sille kannalle, että tietämättömyys onkin sekä
onnen että olemassaolon ehto: nykyaikainen sivistys on hänen
mielestään vain oppinutta raakalaisuutta, yksinkertainen iloitseminen
kauneudesta ja luonnollinen sydämenhyvyys ovat todellisempaa kuin
tieteily ja tietämyskyky. Näitä filosofisia käsityksiään hän vasiten
esittää v. 1894 ilmestyneessä "Le jardin d'Epicure" teoksessaan,
mutta ne ilmenevät hänen tuotannossaan kauttaaltaankin eivätkä
vähimmin tässä pikku suomennoksessa, satunovellissa, joka kuuluu
v. 1909 ilmestyneeseen kokoelmaan nimeltä "Les sept femmes de
Barbe-Bleue? (”Siniparran, seitsemän- vaimoa").

Tietämättömyyden kaunopuheinen puolustaja on itse mitä


monipuolisimmin sivistynyt lukumies, joten hän teoksissaan kykenee
eloisasti asettumaan eri sivistys- ja aikakausiin, eläytymään niiden
henkeen, esittäessään ihmiskuntaa kaikilta mahdollisilta
näkökannoilta. France ei ole välittänyt tarkoin harkittujen romaanien
luomisesta, vaan pikemmin yhdistelee mieleensä juolahtaneita eri
aiheita, pidellen niitä kiehtovan taiteellisesti ja leikittelevällä
mielikuvituksella. Hänen runsaanlaisesta tuotannostaan on vain
muuan varhainen romaani tähän asti ilmestynyt suomeksi, ja
tarpeelliselta on tuntunut esitellä hänet tällaisessa huokeahintaisessa
sarjassa, jonka ohjelmana on edustaa laajalle pohjalle suunniteltua
valikoimaa maailmankirjallisuudesta. Soveliaimmalta on näyttänyt
tällöin satunovelli, jonka alkuperäinen muoto on yltyleiseen tunnettu;
lukijalla on sitä parempi tilaisuus tarkkailla, millä tavoin ranskalaisen
kulttuurin edustaja — kulttuurin arvoa halventaessaankin —
laajentaa tällaista vanhaa aatetarinaa ja käyttää sitä omien
opetustensa välineenä. Siinä myös ilmenee selkeästi kansallisluonne,
jonka piirteistä kevytmielisyys on varmaan liiaksikin pistänyt
ulkomaalaisen silmään, vaikka se useinkin merkitsee vain
suorapuheisuutta asioista, jotka muualla eivät vaiteliaisuudella tule
olemattomiksi.
1. LUKU.

Kuningas Kristoffer, hänen hallituksensa, tapansa ja sairautensa.

Kristoffer V ei ollut mikään huono kuningas. Hän noudatti


tarkalleen eduskunnallisen hallitusmuodon säädöksiä eikä
milloinkaan vastustanut valtiopäiväin tahtoa. Tämä alistuminen ei
tuntunut hänestä lainkaan raskaalta, sillä hän oli tullut huomaamaan,
että jos onkin useita keinoja päästä valtaan, niin ei ole enempää kuin
yksi pysyttäidä vallassa tai käyttää valtaansa — ja että kaikki hänen
ministerinsä, mitä alkuperää he sitten olivatkin, ja mitä periaatteita,
aatoksia ja mielipiteitä he kannattivatkin, kuitenkin hallitsivat samalla
tavalla: muutamista puhtaasti muodollisista pikku eroavaisuuksista
huolimatta he turvallisen tarkoin toistivat edeltäjäinsä menetelmiä.
Sentähden hän empimättä hyväksyikin johtoon kaikki eduskunnan
ehdokkaat, antaen kuitenkin etusijan vallankumouksellisille, koska
nämä yleensä olivat kiivaimpia virkavaltansa toimeenpanijoita.

Omasta puolestaan hän parhaiten harrasti ulkoasioita. Hän teki


usein valtiollisia matkoja, söi ja metsästi toisten kuningas-
serkkujensa kanssa sekä kehui olevansa paras ulkoasiain ministeri,
mitä suinkin saattoi ajatella. Sisäasioissa hän kunnostausi niin hyvin
kuin huonot ajat sallivat. Kansa ei häntä erittäin suuresti rakastanut
tai kunnioittanut, mikä seikka takasi hänelle sen kallisarvoisen edun,
ettei hän koskaan tuottanut pettymyksiäkään. Ollen osaton kansan
innostuksesta ei häntä myöskään uhannut epäsuosio, joka aina
varmasti odottaa jokaista yleisön mielikkiä.

Hänen valtakuntansa oli rikas. Teollisuus ja kauppa kukoistivat


siellä, mutta eivät kuitenkaan siinä määrin, että se olisi
naapurivaltioissa herättänyt rauhattomuutta. Etenkin raha-asiat olivat
oivallisella kannalla. Valtion luotto näytti järkähtämättömältä;
rahamiehet puhuivat siitä innostuneina ja hartain mielin, silmät
täynnä jalon mielisuosion kyyneleitä. Myöskin kuningas Kristoffer
niitti osan tästä kunniasta.

Talonpojat panivat huonon vuodentulon hänen syykseen; mutta


osittainenkin kato oli harvinainen tapaus. Maaperän hedelmällisyys ja
raatajain kärsivällisyys saivat aikaan, että maassa oli runsaasti
hedelmiä, viljaa, viiniä ja karjaa. Tehtaiden työmiehet peloittivat
jatkuvilla ja tuimilla hyökkäyksillään porvareita, jotka vetosivat
kuninkaaseen, jotta hän suojaisi heitä yhteiskunnallista
vallankumousta vastaan; työmiehet eivät puolestaan voineet syöstä
häntä valtaistuimelta, sillä he olivat heikompana puolena, eivätkä he
sitä erittäin halunneetkaan, kun eivät voineet nähdä, mitä hyötyä
heillä olisi tästä valtiokeikauksesta. Hän ei helpottanut eikä lisännyt
heidän taakkaansa, jotta he muuttumatta koskaan vaaraksi pysyivät
aina uhkauksena.

Tämä ruhtinas saattoi myös luottaa sotajoukkoon: siinä vallitsi


hyvä henki. Sotaväessä vallitsee aina hyvä henki, kaikkiin
toimenpiteisiin ja varokeinoihin on ryhdytty, jotta se siinä säilyisi; se
on valtion ensimäinen välttämättömyys. Sillä jos se kadottaisi sen,
olisi hallituskin tuossa tuokiossa kumottu. Kuningas Kristoffer suojasi
uskontoa. Totta puhuen ei hän ollut mikään harras uskovainen, ja
jotta hän ei ajattelisi vastoin uskonkappaleita piti hän varmuuden
vuoksi hyödyllisempänä olla tutustumatta ainoaankaan niistä. Hän
kuunteli säännöllisesti messua kappelissaan sekä jakeli runsaasti
armon- ja suosionosoituksia piispoilleen; näiden joukossa oli kolme
tai neljä kiihkokatolilaista, jotka eivät tehneet muuta kuin sättivät ja
solvasivat häntä. Virkamiehistön orjailu ja halpamaisuus herättivät
hänessä voittamatonta vastenmielisyyttä. Hän ei voinut ymmärtää,
miten hänen alamaisensa saattoivat sietää niin väärää oikeutta;
mutta nämä virkamiehet korvasivat häpeällisen heikkoutensa
voimakkaiden suhteen heltymättömällä kovuudellaan heikkoja
kohtaan. Heidän ankaruutensa oli täten yhteisten etujen valvomista
ja erittäin kunnioitusta herättävää.

Kristoffer V oli huomannut, ettei hänen teoillaan ollut sanottavaa


vaikutusta asiain menoon tai että niillä oli vallan päinvastainen
vaikutus kuin hän oli odottanut. Sentähden hän toimikin
mahdollisimman vähän. Julkiset ritarimerkit ja arvonylennykset olivat
hänen parhaat hallitusvälineensä. Hän jakoi niitä etenkin
vastustajilleen, jotka olivat siitä yhtaikaa nöyryytettyjä ja tyytyväisiä.

Kuningatar oli lahjoittanut hänelle kolme poikaa. Hän oli ruma,


häijy, saita ja tyhmä, mutta kansa, joka tiesi kuninkaan laiminlyövän
ja pettävän häntä, ylisti ja kunnioitti häntä kaikin tavoin.
Tunnusteltuaan monenlaisia ja kaikkiin yhteiskuntaluokkiin kuuluvia
naisia oli kuningas lopulta valinnut mielitietykseen rouva
Kananheimon, jota hän kunnioitti säännöllisillä käynneillään. Naisissa
hän oli aina rakastanut uutuuden viehätystä; mutta uusi nainen ei
ollut enää mikään uutuus hänelle, ja vaihtelun yksitoikkoisuus kävi
hänelle raskaaksi. Kiusaannuksissaan hän aina palautui rouva
Kananheimon luo, ja tuo sama "ennen nähty", joka oli hänestä
sietämätöntä, kun hän tapasi sen ensi kertaa näkemissään naisissa,
kävi sentään jotenkuten laatuun, kun se kuului vanhalle
ystävättärelle. Siitä huolimatta tämä ikävystytti häntä vahvasti ja
jatkuvasti. Väliin, kun hän oli aivan suunniltaan tästä alituisesta
tuhmansekaisesta samankaltaisuudesta, koetti hän saada vaihtelua
aikaan valepukujen avulla ja puetti hänet tyrolittareksi,
andalusialaiseksi, kapusinimunkiksi, rakuunakapteeniksi, nunnaksi,
saattamatta silti hetkeksikään unohtaa kyllästymistään häneen.

Hänen pääasiallisena harrastuksenaan oli metsästys, tuo kaikkien


kuninkaiden ja ruhtinaallisten sukuperintö, jonka he ovat saaneet
lahjaksi alkuihmiseltä — muinaisajan välttämättömyys, joka
vähitellen on muuttunut huvitukseksi; — väsyttävä toimitus, josta
ylhäiset ovat tehneet itselleen ilon. Kaikki ilo on ihmisellä vaivan
takana. Kristoffer V metsästi kuusi kertaa viikossa.

Eräänä päivänä ollessaan metsällä sanoi hän herra Nelilehdelle,


ylimäiselle tallimestarille:

— Mikä surkeus onkaan hirvenjahti!

— Sire, — vastasi tallimestari, — tulette olemaan hyvin


tyytyväinen voidessanne levätä ajon jälkeen.

— Nelilehti, — huokasi kuningas, — olen aina huvitteleinut juuri


siten, että ensin olen väsyttänyt itseni ja sitten levännyt. Mutta nyt
en keksi enää mitään hupia enempää toisesta kuin toisestakaan.
Kaikki hommailu tuntuu minusta tyhjältä kuin laiskuus, ja lepo
väsyttää minua niinkuin vaivaloinen aherrus.
Näin siis Kristoffer V kymmenen hallitusvuoden jälkeen, jotka
olivat kuluneet ilman vallankumouksia ja ilman sotia ja joiden aikana
hän alamaistensa keskuudessa oli saavuttanut taitavan valtiomiehen
maineen ja saanut määräämisvallan kuninkaiden parissa, ei löytänyt
enää mitään iloa eikä nautintoa maailmasta. Synkkään
alakuloisuuteen vajonneena hän puhui useasti tähän tapaan:

— Minulla on lakkaamatta mustat lasit silmieni edessä, ja


kylkirustojeni alla tunnen raskaan kivimöhkäleen, jonka päällä istuu
suru.

Hänellä ei ollut ruokahalua eikä unenlahjaa.

— Minä en voi syödä enää mitään, — sanoi hän usein herra


Nelilehdelle muhkeiden kulta- ja hopeakulhojensa edessä. —
Kuitenkaan en, ikävä kyllä, osaa erityisesti kaivata pöydän iloja, sillä
en ole koskaan saanut nauttia niistä; sitä iloa ei kuninkaalle suoda
koskaan! Minulla on huonoin ruoka koko valtakunnassani. Ainoastaan
yhteinen kansa syö hyvin; rikkailla on kokit, jotka varastavat ja
myrkyttävät heitä. Suurimmat kokit ovat ne, jotka varastavat ja
myrkyttävät kaikkein eniten, ja minulla on Europan etevämmät
keittiötaiturit. Kuitenkin olen minäkin oikeastaan luonnostani
herkkusuu ja olisin niinkuin joku toinenkin mielelläni syönyt
makupaloja, jos vain asemani olisi antanut myöten.

Hän valitteli ristiluitaan säjöilevän ja vatsaansa painostelevan,


tunsi yleistä heikkoutta, kärsien hengenahdistusta ja
sydämentykytystä. Aika ajoin myös veri nousi ilkeästi päähän.

— Minä tunnen, — sanoi hän, — lakkaamatta jonkunlaista


epämääräistä herkeämättömän tasaista kipua, johon kyllä tottuu,
mutta jota silloin tällöin vihlovan tuskan salamat halkovat. Siitä
johtuu voimattomuuteni ja levottomuuteni.

Hänen päätään alkoi usein huimata; hän sai pyörrytys- ja


kouristuskohtauksia, hermosäryn ja puistatuksen puuskia sekä niin
kovia pistoksia molempiin kylkiin, ettei hän voinut hengittää.

Kuninkaan molemmat henkilääkärit tohtori Tinaharkko ja


professori
Aasinleuka totesivat hänen potevan neurasteniaa.

— Epäselvästi kehittynyt taudinpesä! sanoi tohtori Tinaharkko. —


Riittämättömästi rajoittunut sairaustapaus, ja siksi melkein
tavoittamaton…

Professori Aasinleuka keskeytti:

— Eikö totta, Tinaharkko, tässä meillä on edessämme oikea


patologinen Proteus, joka Merehisen tavoin vaihtaa muotoaan
lakkaamatta lääkärin sitä lähennellessä, pukeutuen mitä
omituisimpiin ja kauhistuttavimpiin hahmoihin, milloin vatsahaavan
korppikotkaksi, milloin munuaistulehduksen myrkylliseksi
käärmeeksi, — äkkiä se nostaa näkyviin keltataudin kelmeät kasvot,
väliin taas keuhkotaudin punoittavat poskipäät tai vääntelee
kuristushimoisia sormiaan niin, että voisi luulla sillä olevan
rasvasydämen. Lyhyesti sanoen, se kummittelee kaikkien
ihmisruumiin kuolintautien aaveena, kunnes se vihdoin väistyen
lääkinnällisen käsittelyn tieltä tunnustaa itsensä voitetuksi ja
pakenee todellisessa hahmossaan: tautien apinana.

Tohtori Tinaharkko oli kaunis, kohtelias, miellyttävä, naisten


suosikki, joiden avulla hän ihasteli itseään. Ollen ylhäinen tiedemies
ja hienon maailman lääkäri osasi hän erottaa ylimyksellisyyden
vieläpä jokaisessa umpisuolessa ja mahalaukussakin ja tehdä tarkan
luokkaeron yhteiskunnallisesti eri asemissa olevien kohtujen välillä.
Professori Aasinleuka oli pieni, paksu, lyhyt, ruukun muotoinen ja
suuri suunsoittaja, mutta muuten mitättömämpi kuin hänen
virkaveljensä Tinaharkko. Hänellä oli samat vaatimukset kuin tällä,
mutta vaikeampi puolustaa niitä millään. He vihasivat toisiaan; mutta
tultuaan huomaamaan, että he taistellessaan toisiaan vastaan
tuhoutuisivat molemmat, teeskentelivät he täydellistä
yhteisymmärrystä ja ajatusten sopusointua, — toinen oli tuskin
ehtinyt ilmaista ajatuksensa ennenkuin toinen jo kiirehti sen
omaksumaan. Vaikkakin he molemminpuolisesti halveksivat toistensa
kykyä ja älyä, eivät he kuitenkaan pelänneet vaihtaa mielipiteitä,
tietäen hyvin, ettei siinä vaihtokaupassa olisi mitään vaaraa, ei
häviämisen eikä voittamisen mahdollisuutta, koska oli kysymys
ainoastaan lääketieteellisistä mielipiteistä. Alussa ei kuninkaan
sairaus tuottanut heille mitään levottomuutta. He luottivat siihen,
että sairas itsestään paranisi sillaikaa kun he hoitaisivat häntä ja että
tämä onnellinen yhteensattuma luettaisiin heidän ansiokseen.
Yhteisestä päätöksestä he suosittivat pidättyvää elämäntapaa
("hermosairaille ei lemmenleikkiä"), vahvistavaa ravintojärjestystä,
ruumiinliikuntoa ulkoilmassa, järkevästi sovellettua vesiparannusta.
Tinaharkko ehdotti vielä Aasinleuan suostumuksella
sulfokarbonaattia ja kloorimetyyliä. Aasinleuka määräsi Tinaharkon
myöntymyksellä lisäksi opiumia, Moraalin ja bromin sekaisia liuoksia.

Mutta useampia kuukausia kului kuninkaan tilan näyttämättä


vähääkään parantuvan. Eikä aikaakaan, kun jo kärsimykset kävivät
kovemmiksikin.
— Minusta tuntuu, — sanoi Kristoffer V lääkäreilleen makaillessaan
eräänä päivänä leposohvallaan, — minusta tuntuu siltä kuin jyrsisi
liuta rottia sisälmyksiäni ja kuin vatsassani asuisi joku hirvittävä
kääpiö, tuollainen punaiseen hiippaan, mekkoon ja tossuihin
piiloutunut vuorentonttu, joka lohkoo sitä pala palalta ja kaivelee sen
syvyyksiä.

— Sire, — sanoi tohtori Tinaharkko, — tuo on myötämielistä


tuskaa.

— Minusta se on vastenmielistä, — vastasi kuningas.

Professori Aasinleuka tuli selityksineen avuksi.

— Ei Teidän Majesteettinne vatsa eikä myöskään sisälmystö ole


sairas, mutta jos ne kuitenkin aiheuttavat teille kärsimyksiä, niin se
tapahtuu, sanokaamme vaikka näin, myötätunnosta
keskushermostoanne kohtaan, jonka lukemattomat ärtyneet ja
hämmentyneet säikeet riipovat joka suuntaan vatsaa ja sisälmyksiä
ikäänkuin hehkutetut platinalangat.

— Neurastenia, jatkoi Aasinleuka, kas siinä oikea patologinen


Proteus.

Mutta kuningas lähetti heidät molemmat pois.

Kun he olivat menneet, virkahti herra Pyhä-Sylvanus, kuninkaan


yksityisasiain sihteeri:

— Sire, kysykää neuvoa tohtori Rodrigolta.

— Niinpä niin, sire, sanoi herra Nelilehti, lähettäkää hakemaan


tohtori
Rodrigoa. Ei ole enää muuta neuvoa.

Tähän aikaan tohtori Rodrigo herätti huomiota kautta maailman.


Hän näkyi melkein yht’aikaa kaikissa maailman paikoissa. Hän otti
käynneistään sellaisen maksun, että miljoonamiehetkin tunnustivat
hänen arvonsa. Hänen virkaveljensä kautta koko maapallon, mitä he
sitten yksityisesti ajattelivatkin hänen taidostaan ja luonteensa
laadusta, puhuivat kuitenkin eräänlaisella kunnioituksella miehestä,
joka oli äkkiä saanut nostetuksi lääkärinpalkkiot siihen asti
kuulumattomaan korkeuteen; monet ylistivätkin hänen
menetelmiään, väittäen osaavansa samoja ja käyttävänsä niitä
halvemmalla, ja se vain lisäsi hänen maailmanmainettaan. Mutta kun
tohtori Rodrigoa huvitti sulkea pois sairashoidostaan kaikki
laboratoriotuotteet ja apteekkien valmisteet ja kun hän ei
milloinkaan seurannut lääkekirjojen kaavoja, olivat hänen
parannuskeinonsa hämmästyttävän outoja ja eriskummallisia.

Vaikka herra Pyhä-Sylvanus ei ollutkaan koskaan itse turvautunut


Rodrigon apuun, luotti hän kuitenkin täydellisesti häneen ja uskoi
kuin
Jumalaan.

Hän pyytämällä pyysi kuningasta kutsuttamaan ihmelääkäriä.


Mutta turhaan.

— Minä tyydyn, sanoi Kristoffer V, Tinaharkkoon ja Aasinleukaan,


sillä minä tunnen heidät; minä tiedän, että heistä ei ole mihinkään,
jota vastoin minulla ei ole aavistustakaan siitä, mihin tämä Rodrigo
kykenee.
2. LUKU.

Tohtori Rodrigon parannuskeino.

Kuningas ei ollut koskaan oikein pitänyt kahdesta


henkilääkäristään. Kun hän oli puoli vuotta sairastellut, kävivät he
hänelle aivan sietämättömiksi. Heti kun hän vain kaukaakin näki nuo
kauniit viikset, jotka seppelöivät tohtori Tinaharkon ikuista ja
voitollista hymyä, ja nuo molemmat mustat hiussarvet, jotka olivat
liimatut kiinni Aasinleuan päälakeen, kiristeli hän hampaitaan ja
käänsi äkäisesti katseensa toisaalle. Eräänä yönä hän heitti ikkunasta
ulos kaikki heidän lääkejuomansa, pillerinsä ja jauheensa, jotka
täyttivät huoneen ilkeän masentavalla löyhkällä. Hän ei senjälkeen
ainoastaan varonut tekemästä kaikkea, mitä he määräsivät, vaan
lisäksi ehdoin tahdoin toimi juuri vastoin heidän ohjeitaan. Hän jäi
makuulle silloin kun he ehdottivat liikehtimistä, rehki ja rimpuili silloin
kun he määräsivät lepoa, söi silloin kun he vaativat häntä
noudattamaan ankaraa elantojärjestystä, paastosi silloin, kun he
suosittelivat voimakasta ravintoa, ja kaiken lisäksi osoitti hän rouva
Kananheimoa kohtaan niin väärentelemättömän nuorekasta
lemmenkiihkoa, että tämä ei voinut uskoa edes omien aistiensa
todistukseen, vaan luuli näkevänsä unta. Missään tapauksessa hän ei
parantunut, mistä seikasta voi päättää, että lääketiede on petollinen
taito ja että sen ohjeet, kummin päin niitä sitten seurattaneekin,
ovat yhtä turhia. Hän ei tullut niistä huonommaksi, mutta ei
myöskään paremmaksi.

Hänen runsaat ja moni-ilmeiset tuskansa eivät luopuneet hänestä.


Hän valitteli nyt, että hänen aivoihinsa oli asettunut kokonainen
muurahaispesä ja että tämä toimelias ja sotainen yhdyskunta
kaiverteli sinne käytäviä, huoneita, varastoaittoja, kuletti sinne
muonavaroja ja rakennustarpeita, asetti sinne muniaan
miljaardittain, ravitsi siellä pienokaisiaan, toimeenpani piirityksiä, teki
ja torjui hyökkäyksiä ja kävi siellä koko ajan ankaraa taistelua. Hän
tunsi selvästi, niin hän sanoi, joka kerran kun joku muurahaissoturi
terävillä leukaperillään musersi vihollisensa hennon rintakehän.

— Sire, sanoi herra Pyhä-Sylvanus, lähettäkää hakemaan tohtori


Rodrigoa. Hän parantaa teidät varmaan.

Mutta kuningas vain nosti olkapäitään, ja muutamana heikkouden


ja hajamielisyyden hetkenä hän pyysi takaisin lääkkeensä ja alistui
jälleen lääkäriensä hoitoon. Hän ei mennyt enää rouva Kananheimon
luo, vaan otti hartaasti salpietarihappoisia ukonhattu-pillereitä, jotka
siihen aikaan olivat parhaassa uutuudenvoimassaan ja
nuoruudenkukoistuksessaan. Tämä kieltäytyvä elämäntapa ja
sairaanhoito tuottivat ennen pitkää sellaisen tukehtumiskohtauksen,
että kieli oli revetä hänen suustaan ja silmät kieriä päästä. Hänen
vuoteensa asetettiin silloin pystyyn niinkuin seinäkello, ja hänen
tukehtumistuskaiset kasvonsa paistoivat siitä esiin niinkuin punainen
kellotaulu.

— Sydänhermosto kapinoi valtavasti, sanoi professori Aasinleuka.


— Se on täydessä kuohumistilassa, lisäsi tohtori Tinaharkko.

Herra Pyhä-Sylvanus käytti tilaisuutta hyväkseen uudestaan


suosittaakseen tohtori Rodrigoa, mutta kuningas torjui jäntevästi
tämän ehdotuksen luotaan huomauttaen, ettei hän tarvinnut enää
lisää lääkäreitä.

— Sire, vastasi Pyhä-Sylvanus, tohtori Rodrigo ei ole mikään


lääkäri.

— Eikö todellakaan! huudahti Kristoffer V; tuo mitä nyt sanotte,


herra Pyhä-Sylvanus, puhuu suuresti hänen edukseen ja virittää
minut hänelle koko joukon suosiollisemmaksi. Hän ei siis ole lääkäri.
Mikä hän sitten on?

— Suuri viisas, suuri nero, sire, joka on keksinyt säteilevässä


tilassa olevan aineen ennenkuulumattomat ominaisuudet ja
sovelluttanut niitä lääketieteeseen.

Mutta äänellä, joka ei sietänyt vastaansanomista, kielsi kuningas


käskyläissihteeriään puhumasta mitään tuosta puoskarista.

— En koskaan, murisi hän, en koskaan ota vastaan häntä, en


koskaan.

Kristoffer V:n kesä kului jotakuinkin mukiinmenevästi. Hän teki


pitemmän merimatkan kahdensadan tonnin kantoisella huvijahdilla
rouva Kananheimon kanssa, joka sitä tilaisuutta varten oli puettu
merenvaahdoksi. Hän antoi jahdissaan aamiaiset eräälle tasavallan
presidentille, eräälle kuninkaalle ja eräälle keisarille sekä vahvisti
siellä yksissä neuvoin heidän kanssaan maailman rauhan. Hänestä oli
ikävää noin päätellä kansojen kohtalosta; mutta löydettyään
sensijaan rouva Kananheimon kammiosta erään työläistyttösiä varten
kirjoitetun vanhan romaanin, luki hän sen kannesta kanteen niin
kiihkeällä mielenkiinnolla, että hän joksikin tunniksi suloisesti unohti
koko elämän todellisuuden. Niinpä siis, lukuunottamatta joitakin
tavallisen päänsäryn, hermokivun, reumatismin ja elämään
kyllästymisen puuskia, hänen tilansa oli verrattain siedettävä. Syksyn
tullen hän sai takaisin entiset tuskansa. Hän kärsi sanoin
kuvaamattomasti, niinkuin ihminen, jonka ruumis jaloista vyötäisiin
asti on jäässä, mutta koko runko liekkien vallassa. Mutta enimmin
häntä kuitenkin kidutti ja hirvitti se, että häntä tämän lisäksi
ahdistivat eräänlaiset tunnelmat, joita hän ei voinut edes selittää, —
epämääräiset kauhuntilat. Toiset niistä, sanoi hän, olivat sellaisia,
että ne saivat hiukset nousemaan pystyyn hänen päässään.
Verenvähyys uuvutti häntä ja hänen heikkoutensa lisääntyi päivä
päivältä, kärsimiskykynsä lainkaan vähenemättä.

— Herra Pyhä-Sylvanus, sanoi hän eräänä aamuna levottoman yön


jälkeen, te olette minulle useamman kerran puhunut tohtori
Rodrigosta. Antakaa hänen tulla.

Tohtori Rodrigo oli näihin aikoihin nähty Kap-maalla,


Melbournessa, Pietarissa. Heti lähetettiin kaapeliviestit ja
langattomat sähkösanomat kaikkiin näihin suuntiin. Ei ollut vielä
viikkoakaan kulunut, kun jo kuningas alkoi hartaasti tiedustaa tohtori
Rodrigoa. Seuraavina päivinä hän kysyi joku minuutti: "Eikö hän jo
pian tule?"

Häntä lohdutettiin sillä, että Hänen Majesteettinsa ei ollut suinkaan


mikään halveksittava potilas ja että Rodrigo matkusti uskomattoman
nopeasti. Mutta mikään ei voinut tyynnyttää sairaan
kärsimättömyyttä.
— Hän ei tulekaan, huokaili hän, saattepa nähdä, että hän ei tule.

Genuasta saapui sähkösanoma, jossa ilmoitettiin, että Rodrigo oli


tulossa Preussen-laivalla. Kolme päivää myöhemmin tuo
suurmaailmallinen lääkäri, tehtyään ensin röyhkeän alentuvaisen
vieraskäynnin virkaveljiensä Tinaharkon ja Aasinleuan luo, ilmestyi
palatsiin.

Hän oli nuorempi ja kauniimpi kuin tohtori Tinaharkko ja hänen


ilmeensä oli ylpeämpi ja ylväämpi. Kunnioituksesta luontoa kohtaan,
jota hän totteli joka asiassa, hän antoi tukkansa ja partansa vapaasti
kasvaa ja muistutti ulkonäöltään noita muinaisajan filosofeja, joita
kreikkalaiset ovat veistäneet marmoriin.

Tutkittuaan kuningasta hän sanoi:

— Sire, lääkärit, jotka puhuvat taudeista niinkuin sokeat väreistä,


sanovat että teitä vaivaa neurastenia eli hermojen heikkous. Mutta
täten todettuaan tautinne eivät he siitä huolimatta kykene sitä
parantamaan, sillä elimellistä kudosta ei voida uudistaa muilla
keinoin kuin niillä, joita luonto on käyttänyt niitä rakentaessaan.
Mitkä ovat siis luonnon keinot ja menettelytavat? Luonnolla ei ole
kättä eikä erikoista työkalua; se on hienon hieno, se on henkevä;
kaikkein valtavimpiinkin rakennelmiinsa se käyttää äärettömän pieniä
ainesosia, atoomia, protyylia. Näkymättömästä sumusta se luo
kallioita, metalleja, kasveja, eläimiä, ihmisiä. Millä tavoin?
Vetovoiman, painolain, erittyväisyyden, läpitunkevaisuuden,
liukenevaisuuden, imeytyväisyyden, hiushuokoisuuden, sisäisen
sukulaisuuden ja myötämielisyyden avulla. Yksin hiekkajyvänkin luo
se samoin kuin se on luonut Linnunradan: avaruuksien
sopusointuisuus vallitsee niin toisessa kuin toisessakin; molemmat
ovat ne olemassa ainoastaan niitä muodostavien ainesosien liikkeen
vaikutuksesta, mitkä ainesosat juuri ovat niiden soiva, rakastava ja
ainaisessa liikkeessä oleva sielu. Ei ole mitään rakenteellista eroa
taivaan tähtien ja noiden pölyhiukkasten välillä, jotka tuossa
tanssivat edessämme huoneeseen tunkeutuvassa auringonsäteessä,
ja pienin noista pölyhiukkasista on yhtä ihana kuin Sirius, sillä
kaikissa luomakunnan olioissa tapahtuu tuo sama äärettömän pieni,
muotoa antava ja elämää ylläpitävä ihme. Siten työskentelee luonto.
Tuosta näkymättömästä, huomaamattomasta ja punnitsemattomasta
se on kehittänyt koko tämän avaran, aistein havaittavan maailman,
jota meidän henkemme nyt arvioi ja punnitsee, ja se, mistä se on
meidät itsemme tehnyt, on mitättömämpää kuin hengähdys.
Toimikaamme siis samoin kuin se tuon punnitsemattoman,
näkymättömän ja huomaamattoman avulla, käyttäen hyväksemme
samaa myötämielisyyden vetovoimaa ja hienon hienoa
läpitunkevaisuutta. Siinä asian ydin. Miten sovelluttaa sitä kyseessä
olevaan tapaukseen? Miten elvyttää jälleen loppuun kuluneet
hermot, kas siinä seikka, joka meidän vielä on saatava selville.

Ja ensinnäkin, mitä ovat hermot? Jos kysymme niiden määritelmää


keltä hyvänsä vähäpätöisimmältäkin fysiologilta, jopa vaikka
esimerkiksi joltakin Aasinleualta tai Tinaharkolta, saamme heti
vastauksen. Mitä ovat hermot? Lankoja, säikeitä, jotka lähtevät
aivoista ja selkäytimestä ja jakautuvat ruumiin kaikkiin osiin,
välittäen niihin tajunnan kiihoituksia ja pannen liikkeelle toimintaa
välittäviä jäseniä. Hermot ovat siis aistimusta ja liikuntoa. Tämä
riittääkin jo meille valaisemaan niiden sisäisen kokoonpanon, niiden
oleellisimman olemuksen: annettakoon sille sitten mikä nimi
hyvänsä, niin on se samaa, jota me aistimusten piirissä nimitämme
iloksi ja siveellisyyden piirissä onneksi. Missä vain on ilon ja onnen
atoomeja, siellä on myös hermojen uudistumisainetta. Ja kun minä
sanon ilon atoomi, tarkoitan sillä todellakin erästä aineellista oliota,
erästä määrättyä elinainetta, tuntevaa kappaletta, joka voi ilmetä
kaikissa neljässä tilassa: kiinteässä, juoksevassa, kaasumaisessa ja
säteilevässä, kappaletta, jonka atoomipainon voi määrätä. Ilo ja
suru, joiden vaikutukset ovat tuttuja ihmisille, eläimille ja kasveille
aina aikojen alusta, ovat todellisia elinaineita: ne ovat ainetta, koska
ne ovat henkeä ja koska luonto kaikissa kolmessa
ilmestymismuodossaan, liikkeenä, aineena ja älynä, on yhtä.
Tarvitsee siis vain hankkia riittävä määrä ilon atoomeja ja istuttaa ne
elimistöön ihohuokoisuuden ja hengityksen avulla. Sentähden
määrään teidät pitämään onnellisen miehen paitaa.

— Mitä! huudahti kuningas, te tahdotte, että käyttäisin onnellisen


miehen paitaa!

— Niin, aivan ihoa vasten, sire, jotta teidän kuivettunut nahkanne


imisi itseensä niitä onnen ainesosia, joita tuon onnellisen miehen
hikirauhaset ovat uhonneet eristyskanaviaan myöten hänen
onnentäydestä kudoksestaan. Sillä tiedättehän, miten iho toimii: se
hengittää sisään ja ulos, välittäen lakkaamatonta aineenvaihdosta
ympäristössään.

— Ja tuo on siis se parannuskeino, jonka minulle määräätte, herra


Rodrigo?

— Sire, sen tehokkaampaa ei voi yleensä määrätä.


Lääkeluetteloissa ei ole mitään, jota voisi vaikutuksiensa puolesta
siihen edes verrata. Tuntematta luontoa, ja kykenemättä sitä
mitenkään jäljentämään, meidän pillerinpyörittäjämme osaavat
tehtaissaan valmistaa ainoastaan pienen määrän lääkkeitä, jotka
aina ovat vaarallisia ja vain harvoin tehokkaita. Siispä ne lääkkeet,
joita me emme osaa tehdä, ovat otettavat luonnosta valmiina,
niinkuin esimerkiksi iilimadot, vuori-ilmasto, meri-ilma, kuumat
luonnonlähteet, tamman maito, villikissan nahka ja onnellisesta
miehestä uhonneet ruumiinnesteet… Ettekö siis tiedä, että raaka
peruna, jos sitä pitää taskussaan, ottaa pois reumaattisen säryn? Te
halveksitte luonnollista parannuskeinoa; teillä pitää olla keinotekoiset
ja kemialliset rohdokset; teillä pitää olla tipat ja jauheet: teillä on
mahtanut siis olla niistä paljon apua, noista tipoistanne ja
jauheistanne?

Kuningas pyyteli anteeksi ja lupasi totella.

Tohtori Rodrigo, joka jo oli ovella poislähdössä, käännähti ympäri.

— Antakaa vähän lämmittää sitä, sanoi hän, ennenkuin panette


sen päällenne.
3. LUKU.

Herrat Nelilehti ja Pyhä-Sylvanus etsivät onnellista miestä kuninkaan


palatsista.

Tahtoen mitä pikimmiten saada ylleen parannusta tuottavan


paidan, Kristoffer V kutsutti luokseen Nelilehden, ylimäisen
tallimestarinsa, ja Pyhä-Sylvanuksen, yksityisasiainsa sihteerin, sekä
antoi heille tehtäväksi hankkia se hänelle mahdollisimman lyhyessä
ajassa.

Sovittiin siitä, että he pitäisivät täydellisesti salassa etsiskelyjensä


esineen. Oli nimittäin pelättävää, että jos yleisö saisi tietää,
minkälaatuista parannuskeinoa kuningas tarvitsee, suuret joukot
onnettomia ja etenkin juuri kaikkein onnettomimmat, kaikkein eniten
kurjuuden raskauttamat, tarjoisivat paitaansa palkinnon toivossa.
Pelättiin myös, että anarkistit voisivat lähettää myrkytettyjä paitoja.

Nuo molemmat aatelisherrat luulivat voivansa saada käsiinsä


tohtori Rodrigon lääkkeen tarvitsematta mennä palatsia ulommas, ja
sentähden he asettuivat erään pienen pyörö-ikkunan ääreen, josta
saattoi nähdä ohikulkevat hovimiehet. Kaikki ne, jotka tulivat heidän
näkyviinsä, olivat pitkänaamaisia ja happamen näköisiä, heidän
vaivansa oli selvästi kirjoitettu heidän otsalleen, heitä kulutti
hivuttava kurkoitus johonkin virkaan, johonkin arvoluokkaan,
johonkin etuoikeuteen tai ritarimerkkiin. Mutta laskeuduttuaan
suureen hovihuoneustoon Nelilehti ja Pyhä-Sylvanus näkivät hra
Lehdonrauhan, joka nukkui eräässä nojatuolissa suu auki korviin asti,
sieramet levällään, posket punaisina ja loistavina kuin kaksi aurinkoa,
rinta sopusointuisessa aaltoilussa, vatsa yhtä poljennollisena ja
rauhallisena, kasvot naurussa, uhoten iloa aina pääkopan
säteilevästä kupukatosta harittavien jalkojen varpaisiin asti, jotka
mukavasti ojenteleivat keveissä puolikengissään.

Tämän nähtyään sanoi Nelilehti:

— Älkäämme enää etsikö tämän enempää. Kun hän herää,


pyydämme häneltä hänen paitansa.

Tuossa tuokiossa nukkuja heräsikin, hieroi silmiään, venytteli


jäseniään ja katseli surkean näköisenä ympärilleen. Hänen
suupielensä venähtivät alas, hänen poskensa painuivat lyttyyn;
hänen silmäluomensa jäivät surullisesti riipuksiin niinkuin vaaterievut
köyhien ikkunoissa; hänen rinnastaan tunkeutui valittava huokaus, ja
koko hänen olentonsa ilmaisi ikävystymistä, kaihoa ja pettymystä.

Huomattuaan yksityisasiaan sihteerin ja ensimäisen tallimestarin,


hän sanoi:

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

He kohtasivat käytävässä erään valtakunnan päärin, joka


hämmästytti maailmaa luonteensa lujuudella ja henkensä syvyydellä.
Yksinpä hänen vihollisensakin myönsivät hänen epäitsekkyytensä,
suoruutensa ja rohkeutensa. Tiedettiin, että hän paraillaan kirjoitti
muistelmiaan ja jokainen mielisteli häntä, päästäkseen siellä
kunniakkaalle paikalle jälkimaailman silmissä.

— Hän on ehkä onnellinen, sanoi Pyhä-Sylvanus.

— Kysykäämme sitä häneltä, sanoi Nelilehti.

He lähestyivät häntä, vaihtoivat hänen kanssaan muutamia sanoja


ja sitten johtaen keskustelun onneen, tekivät tuon kysymyksen, joka
oli heidän sydämellään.

— Rikkaus ja kunnia eivät liikuta minua, vastasi hän, — ja minun


sydämeni on vapaa yksinpä kaikkein laillisimmista ja
luonnollisimmista hellyyssuhteista, kuten perhesiteistä ja ystävyyden
iloista. En tunne kiintymystä muuhun kuin yhteishyvän asioihin ja se
on kaikkein onnettomin intohimo, kaikkein hankalin rakkaus.

Olen ollut vallassa; silloin kieltäydyin ylläpitämästä valtion varoilla


ja sotamiestemme verellä niitä retkikuntia, joita merirosvot ja
kauppiaat olivat järjestäneet rikastuttaakseen itseään ja
hävittääkseen valtiota; en luovuttanut laivastoa enkä sotajoukkoa
hankitsijoiden saaliiksi, ja silloin jouduin kaikkien näiden veijarien
vihoihin, jotka panettelivat ja soimasivat minua tyhmän väkijoukon
säestäminä siitä, että olin pettänyt isänmaani kunnian pyhimmät
edut. Näitä suurryöväreitä vastaan ei kukaan minua puolustanut.
Nähtyäni kuinka typerä ja halpamainen kansan tuntemustapa on,
olen ruvennut kaipaamaan itsevaltiutta. Kuninkaan heikkous tekee
minut vallan epätoivoiseksi; suurien pienuus on minulle tuiki
tuskallinen näky; ministerien kyvyttömyys, vilpillisyys,
kansanedustajien tietämättömyys, alhaisuus ja itsensä
kauppaaminen saattavat minut vuoroin tylsän välinpitämättömyyden,
vuoroin raivon valtaan. Lievittääkseni jollakin niitä tuskia, joissa
päivisin kidun, kirjoitan öisin ja puran siten esille sen sapen, jota
alituisesti saan niellä.

Nelilehti ja Pyhä-Sylvanus heilauttivat hattuaan jalolle paarille ja


lähtivät eteenpäin. Ehdittyään muutaman askeleen käytävässä
joutuivat he vastakkain muutaman aivan pienen miehen kanssa, joka
nähtävästi oli kyttyräselkäinen, sillä hänen selkänsä kohosi esiin
pään yläpuolelta, kun hän keikailevalla ja mielistelevällä tavalla
keinutteli ruumistaan.

— On turhaa, sanoi Nelilehti, kääntyä tuon puoleen.

— Kukapa tietää, äännähti Pyhä-Sylvanus.

— Uskokaa minua: minä tunnen hänet, jatkoi tallimestari, — minä


olen hänen uskottunsa. Hän on tyytyväinen itseensä ja joka
suhteessa mieltynyt omaan olemukseensa, ja hänellä on siihen
syynsä. Tämä pieni kyttyräselkä on naisten lemmikki. Hovinaiset ja
kaupungin naiset, näyttelijättäret, porvarisnaiset, ilotytöt, niin
keikailevat ja tekopyhät kuin uskovaisetkin, ylpeimmätkin ja
kauneimmatkin, kaikki ovat hänen jalkojensa juuressa. Heitä
tyydyttääkseen hän hukkaa terveytensä ja elämänsä, hän on käynyt
synkkämieliseksi, onnenkantajan virka alkaa käydä hänelle raskaaksi.
Aurinko oli jo mailleen painumassa ja kuultuaan, ettei kuningas
tänään ollenkaan näyttäytyisi, lähtivät viimeisetkin hovimiehet pois,
jättäen hovihuoneustot autioiksi.

— Antaisin kyllä mielelläni oman paitani, sanoi Nelilehti; voinpa


vakuuttaa, että minulla on erittäin onnellinen luonnonlaatu. Minä
olen aina tyytyväinen; minä syön ja juon hyvin. Minua kehutaan
kukoistavan näköiseksi; minun kasvojani pidetään miellyttävinä. Eikä
minulla olekaan kasvojeni suhteen mitään valittamista. Mutta
virtsarakkoani sensijaan kuumottaa ja painaa niin että se turmelee
minulta elämänilon. Tänä aamuna päästin ilmoille kiven, joka oli
suuri kuin kyyhkysen muna. Pelkään, että minun paidastani ei olisi
mitään hyötyä kuninkaalle.

— Antaisin minäkin omani, sanoi Pyhä-Sylvanus. Mutta on sitä


kiveni minullakin, ja se kivi on vaimoni. Olen naimisissa rumimman ja
ilkeimmän luontokappaleen kanssa, mitä koskaan on maailmassa
ollut, ja vaikkakin tiedän, että tulevaisuus on Jumalan kädessä,
lisään vahvalla vakaumuksella: ilkeimmän ja rumimman kanssa, mitä
koskaan tulee maan pinnalla olemaan, sillä sellaisen alkukuvan
toistuminen on niin epätodennäköistä, että voi yksinkertaisesti pitää
sitä mahdottomana…

Sitten luopuen tästä kiusallisesta puheenaineesta hän jatkoi:

— Nelilehti, ystäväni, olemme erehtyneet suunnasta. Onnellista ei


tule etsiä hovista eikä tämän maailman mahtavien parista.

— Te puhutte kuin filosofi, tokaisi siihen Nelilehti; te haastelette


aivan kuin tuo kerjäläinen Jean-Jacques [tarkoittaa Jean-Jacques
Rousseauta]. Te teette siinä itsellenne vääryyttä. Onnellisia ja onnen
arvoisia henkilöitä on kyllä yhtä paljon kuninkaan palatsissa ja
ylhäisön salongeissa kuin kirjailijakahviloissa ja työväen kapakoissa.
Jos emme olekaan tänään sellaista löytäneet näiden seinien sisältä,
niin johtuu se siitä, että on myöhäinen hetki ja että meillä ei sattunut
olemaan suotuista onnea. Menkäämme tänä iltana kuningattaren
pelihuoneeseen ja me onnistumme varmasti paremmin.

— Etsiä onnellista ihmistä pelipöydän ympäriltä! huudahti Pyhä-


Sylvanus, se on yhtä turhaa kuin etsiä helminauhaa naurismaasta tai
totuutta valtiomiehen huulilta!… Mutta Espanjan lähettiläs pitää tänä
yönä juhlat, koko kaupunki on siellä. Menkäämme sinne ja me
saamme helposti käsiimme hyvän ja sopivan paidan.

— Minulle on kyllä sattunut joskus, sanoi Nelilehti, että olen


pidellyt käsissäni jonkun onnellisen naisen paitaa. Se oli aina erittäin
miellyttävää. Mutta meidän onnemme kesti vain lyhyen hetken. Jos
puhun teille tästä, niin ei se tapahdu siksi, että tahtoisin sillä kerskua
(se ei todellakaan kannata) tai että tahtoisin muistutella mielessäni
menneitä iloja, jotka ovat milloin hyvänsä takaisin saatavissa, sillä
aivan päinvastoin kuin sananlaskussa sanotaan: jokaisella
ikäkaudella on sama ilo. Ei, tarkoitukseni on aivan toinen, se on
vakavampi ja hyveellisempi ja suoranaisessa yhteydessä sen ylevän
tehtävän kanssa, joka meille molemmille on annettu toimeksi:
tahdon esittää teille erään ajatuksen, joka juuri äsken syntyi
aivoissani. Ettekö usko, Pyhä-Sylvanus, että määrätessään lääkkeeksi
onnellisen miehen paidan, tohtori Rodrigo käytti "mies" sanaa
ylimalkaisessa merkityksessä, tarkoittaen sillä sukupuoleen
katsomatta koko ihmissukua yleensä, ja siis naisen paitaa yhtä hyvin
kuin miehenkin? Minä puolestani olisin taipuvainen näin
ajattelemaan, ja jos teidänkin käsityksenne kävisi samaan suuntaan,
voisimme laajentaa tutkimuspiiriämme ja lisätä suotuisia edellytyksiä
enemmän kuin toisella mokomalla, sillä hienossa ja sivistyneessä
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like