Developing Graphics Frameworks with Python and OpenGL 1st edition by Lee Stemkoski, Michael Pascale ISBN 0367721805 Â 978-0367721800 instant download
Developing Graphics Frameworks with Python and OpenGL 1st edition by Lee Stemkoski, Michael Pascale ISBN 0367721805 Â 978-0367721800 instant download
https://ebookball.com/product/3-d-computer-graphics-mathematical-
introduction-with-opengl-1st-edition-by-medhat-rahim-19808/
https://ebookball.com/product/3d-computer-graphics-a-
mathematical-introduction-with-opengl-1st-edition-by-samuel-r-
buss-isbn-0521821037-9780521821032-14672/
https://ebookball.com/product/interactive-computer-graphics-a-
top-down-approach-with-shader-based-opengl-6th-edition-by-edward-
angel-dave-shreiner-isbn-0132545233-9780132545235-10844/
(Ebook PDF) Beginning Java Game Development & LibGDX 1st edition by
Lee Stemkoski 1484215001 9781484215005 full chapters
https://ebookball.com/product/ebook-pdf-beginning-java-game-
development-libgdx-1st-edition-by-lee-
stemkoski-1484215001-9781484215005-full-chapters-22644/
(Ebook PDF) Learn OpenGL ES For Mobile Game and Graphics Development
1st edition by Prateek Mehta 1430250542 9781430250548 full chapters
https://ebookball.com/product/ebook-pdf-learn-opengl-es-for-
mobile-game-and-graphics-development-1st-edition-by-prateek-
mehta-1430250542-9781430250548-full-chapters-22624/
https://ebookball.com/product/data-structures-and-algorithms-in-
python-1st-edition-by-michael-goodrich-roberto-tamassia-michael-
goldwasser-isbn-9781118476734-1118476735-15762/
https://ebookball.com/product/engineering-design-and-graphics-
with-solidworks-2016-1st-edition-by-james-bethune-
isbn-013450769x-9780134507699-18212/
Delphi Graphics and Game Programming Exposed with DirectX For versions
5 0 7 0 Table of Contents 1st Edition by Delphi Graphics
https://ebookball.com/product/delphi-graphics-and-game-
programming-exposed-with-directx-for-versions-5-0-7-0-table-of-
contents-1st-edition-by-delphi-graphics-11194/
Lee Stemkoski
Michael Pascale
First edition published 2022
by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742
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.
“The Open Access version of this book, available at www.taylorfrancis.com, has been made
available under a Creative Commons Attribution-Non Commercial-No Derivatives 4.0 license”
Trademark notice: Product or corporate names may be trademarks or registered trademarks and
are used only for identification and explanation without intent to infringe.
DOI: 10.1201/9781003181378
Authors, ix
v
vi ◾ Contents
INDEX, 331
Authors
ix
CHAPTER 1
Introduction to
Computer Graphics
DOI: 10.1201/9781003181378-1 1
2 ◾ Developing Graphics Frameworks with Python and OpenGL
at full (100%) intensity. Tese three colors are typically used since photore-
ceptors in the human eye take in those particular colors. Te triple (1, 0, 0)
represents red, (0, 1, 0) represents green, and (0, 0, 1) represents blue. Black
and white are represented by (0, 0, 0) and (1, 1, 1), respectively. Additional
colors and their corresponding triples of values specifying the amounts of
red, green, and blue (ofen called RGB values) are illustrated in Figure 1.4.
Te quality of an image depends in part on its resolution (the number of
pixels in the raster) and precision (the number of bits used for each pixel).
As each bit has two possible values (0 or 1), the number of colors that can
be expressed with N-bit precision is 2 N . For example, early video game
8
consoles with 8-bit graphics were able to display 2 = 256 diferent colors.
Monochrome displays could be said to have 1-bit graphics, while modern
displays ofen feature “high color” (16-bit, 65,536 color) or “true color”
(24-bit, more than 16 million colors) graphics. Figure 1.5 illustrates the
same image rendered with high precision but diferent resolutions, while
Figure 1.6 illustrates the same image rendered with high resolution but
diferent precision levels.
In computer science, a bufer (or data bufer, or bufer memory) is a part
of a computer's memory that serves as temporary storage for data while
it is being moved from one location to another. Pixel data is stored in a
region of memory called the framebufer. A framebufer may contain mul-
tiple bufers that store diferent types of data for each pixel. At a minimum,
the framebufer must contain a color bufer, which stores RGB values.
When rendering a 3D scene, the framebufer must also contain a depth
bufer, which stores distances from points on scene objects to the virtual
camera. Depth values are used to determine whether the various points
on each object are in front of or behind other objects (from the camera’s
perspective), and thus whether they will be visiblewhen the scene is ren-
dered. If one scene object obscures another and a transparency efect is
Introduction to Computer Graphics ◾ 5
in the Xbox video game console. In general, GPUs feature a highly parallel
structure that enables them to be more efcient than CPUs for rendering
computer graphics. As computer technology advances, so does the quality
of the graphics that can be rendered; modern systems are able to produce
real-time photorealistic graphics at high resolutions.
Programs that are run by GPUs are called shaders, initially so named
because they were used for shading efects, but now used to perform many
diferent computations required in the rendering process. Just as there are
many high-level programming languages (such as Java, JavaScript, and
Python) used to develop CPU-based applications, there are many shader
programming languages. Each shader language implements an application
programming interface (API), which defnes a set of commands, functions,
and protocols that can be used to interact with an external system—in this
case, the GPU. Some APIs and their corresponding shader languages include
Tis book will focus on OpenGL, as it is the most widely adopted graphics
API. As a cross-platform library, visual results will be consistent on any
supported operating system. Furthermore, OpenGL can be used in con-
cert with a variety of high-level languages using bindings: sofware librar-
ies that bridge two programming languages, enabling functions from one
language to be used in another. For example, some bindings to OpenGL
include
Each of these stages is described in more detail in the sections that follow;
the next chapter contains code that will begin to implement many of the
processes described here.
Figure 1.9 illustrates diferent renderings of a sphere that make use of these
attributes. Additional vertex attributes may be defned as needed.
During the geometry processing stage, the vertex shader is applied to
each of the vertices; each attribute variable in the shader receives data
from a bufer according to previously specifed associations. Te pri-
mary purpose of the vertex shader is to determine the fnal position of
Introduction to Computer Graphics ◾ 11
FIGURE 1.10 One scene rendered from multiple camera locations and angles.
FIGURE 1.11 A series of cubes rendered with orthogonal projection (a) and
perspective projection (b).
1.2.3 Rasterization
Once the fnal positions of each vertex have been specifed by the vertex
shader, the rasterization stage begins. Te points themselves must frst be
grouped into the desired type of geometric primitive: points, lines, or tri-
angles, which consist of sets of 1, 2, or 3 points. In the case of lines or
triangles, additional information must be specifed. For example, consider
an array of points [A, B, C, D, E, F] to be grouped into lines. Tey could
be grouped in disjoint pairs, as in (A, B), (C, D), (E, F), resulting in a set
of disconnected line segments. Alternatively, they could be grouped in
overlapping pairs, as in (A, B), (B, C), (C, D), (D, E), (E, F), resulting in a
set of connected line segments (called a line strip). Te type of geometric
Introduction to Computer Graphics ◾ 13
each interior point is interpolated from the values at the vertices: calculated
using a weighted average, depending on the distance from the interior
point to each vertex. Te closer an interior point is to a vertex, the greater
the weight of that vertex’s value when calculating the interpolated value.
For example, if the vertices of a triangle are assigned the colors red, green,
and blue, then each pixel corresponding to the interior of the triangle will
be assigned a combination of these colors, as illustrated in Figure 1.13.
FIGURE 1.14 An image fle (a) used as a texture for a 3D object (b).
print("Hello, world!")
print("Have a nice day!")
FIGURE 1.19 Results of running the Python program from Figure 1.18.
Figure 1.19 illustrates the results of running this code, which appear in a
shell window.
To verify that these packages have been installed correctly, open a new
IDLE shell window (restart IDLE if it was open before installation). To
check Pygame, enter the following code, and press the Enter key:
import pygame
You should see a message that contains the number of the Pygame
version that has been installed, such as "pygame 1.9.6", and a greet-
ing message such as "Hello from the pygame community". If
instead you see a message that contains the text No module named
'pygame', then Pygame has not been correctly installed. Furthermore,
it will be important to install a recent version of Pygame—at least a
development version of Pygame 2.0.0. If an earlier version has been
installed, return to the command prompt and in the install command
above, change pygame to pygame==2.0.0.dev10 to install a more
recent version.
Similarly, to check the Numpy installation, instead use the code:
import numpy
In this case, if you see no message at all (just another input prompt), then
the installation was successful. If you see a message that contains the text
No module named 'numpy', then Numpy has not been correctly
installed. Finally, to check PyOpenGL, instead use the code:
import OpenGL
As was the case with testing the Numpy package, if there is no message
displayed, then the installation was successful, but a message mentioning
that the module is not installed will require you to try re-installing the
package.
If you encounter difculties installing any of these packages, there is
additional help available online:
• Pygame: https://www.pygame.org/wiki/GettingStarted
• Numpy: https://numpy.org/install/
• PyOpenGL: at http://pyopengl.sourceforge.net/documentation/
installation.html
Introduction to Computer Graphics ◾ 21
be found via the download link previously mentioned. While a free trial
version is available, if you choose to use this sofware extensively, you are
encouraged to purchase a license.
Afer installation, start the Sublime Text sofware. A new editor window
will appear, containing an empty fle. As previously mentioned, Sublime
Text can be used to run Python scripts automatically, provided that Python
has been installed for all users of your computer and it is included on the
system path. To try out this feature, in the editor window, as shown in
Figure 1.21, enter the text:
print("Hello, world!")
Next, save your fle with the name test.py; the.py extension causes
Sublime Text to recognize it as a Python script fle, and syntax highlighting
will be applied. Finally, from the menu bar, select Tools > Build or press
the keyboard key combination Ctrl + B to build and run the application.
Te output will appear in the console area, as illustrated in Figure 1.22.
Introduction to Computer Graphics ◾ 23
Introduction to
Pygame and OpenGL
I n this chapter, you will learn how to create windows with Pygame
and how to draw graphics in these windows with OpenGL. You will
start by rendering a point, followed by lines and triangles with a single
color. Ten, you will draw multiple shapes with multiple colors, create a
series of animations involving movement and color transitions, and imple-
ment interactive applications with keyboard controlled movement.
DOI: 10.1201/9781003181378-2 25
26 ◾ Developing Graphics Frameworks with Python and OpenGL
First, you will create a class called Base that initializes Pygame and
displays a window. Anticipating that the applications created will eventu-
ally feature user interaction and animation, this class will be designed to
handle the standard phases or “life cycle” of such an application:
• Startup: During this stage, objects are created, values are initialized,
and any required external fles are loaded.
• Te Main Loop: Tis stage repeats continuously (typically 60 times
per second), while the application is running and consists of the
following three substages:
• Process Input: Check if the user has performed any action that
sends data to the computer, such as pressing keys on a keyboard
or clicking buttons on a mouse.
• Update: Changing values of variables and objects.
• Render: Create graphics that are displayed on the screen.
• Shutdown: Tis stage typically begins when the user performs an
action indicating that the program should stop running (for example,
by clicking a button to quit the application). Tis stage may involve
tasks such as signaling the application to stop checking for user input
and closing any windows that were created by the application.
to create a new fle named __init __.py (note the double underscore
characters that occur before and afer init). Any code in the __init __.
py fle will be run when modules from this package are imported into
another program; leave this as an empty fle. Next, also in the core folder,
create a new fle named base.py, and enter the following code (which con-
tains some basic comments that will be explained more fully afer):
import pygame
import sys
class Base(object):
def initialize(self):
pass
def run(self):
## startup ##
self.initialize()
## main loop ##
while self.running:
## process input ##
## update ##
self.update()
## render ##
# display image on screen
pygame.display.flip()
## shutdown ##
pygame.quit()
sys.exit()
import pygame
class Input(object):
def __init__(self):
Introduction to Pygame and OpenGL ◾ 31
def update(self):
# iterate over all user input events (such as
keyboard or
# mouse)that occurred since the last time
events were checked
# for event in pygame.event.get():
# quit event occurs by clicking button to
close window
if event.type == pygame.QUIT:
self.quit = True
At present, the Input class only monitors for quit-type events; in later
sections, keyboard functionality will be added as well. For now, return to
the Base class. Afer the import statements, add the code:
Tis will enable you to use the Input class from the input module
in the core package. It should be noted that the import statements
are written assuming that your application fles (which will extend the
Base class) will be stored in the main directory (which contains all the
packages).
Next, at the end of the init function, add the code:
Tis will create and store an instance of the Input class when the Base
class is created.
Finally, in the run function, afer the comment ## process input
##, add the code:
self.input.update()
if self.input.quit:
self.running = False
Tis will enable the user to stop the application, as described prior to the
code listing for the Input class.
32 ◾ Developing Graphics Frameworks with Python and OpenGL
You will next write an application that uses these classes to create a win-
dow. Te general approach in this and similar applications will to extend
the Base class, implement the initialize and update functions, and
then, create an instance of the new class and call the run function. To
proceed, in your main folder, create a new fle named test-2-1.py with
the code:
class Test(Base):
def initialize(self):
print("Initializing program...")
def update(self):
pass
void main()
{
// code statements here
}
will be supplied from the vertex shader (interpolated during the rasteriza-
tion stage), while out indicates values will be stored in one of the various
bufers (color, depth, or stencil).
Tere are two particular out variables that are required when writ-
ing shader code for a GPU program. First, recall that the ultimate goal
of the vertex shader is to calculate the position of a point. OpenGL uses
the built-in variable gl _ Position to store this value; a value must be
assigned to this variable by the vertex shader. Second, recall that the ulti-
mate goal of the fragment shader is to calculate the color of a pixel. Early
versions of OpenGL used a built-in variable called gl _ FragColor to
store this value, and each fragment shader was required to assign a value
to this variable. Later versions require fragment shader code to explic-
itly declare an out variable for this purpose. Finally, it should be men-
tioned that both of these variables are vec4 type variables. For storing
color data, this makes sense as red, green, blue, and alpha (transparency)
values are required. For storing position data, this is less intuitive, as a
position in three-dimensional space can be specifed using only x, y, and
z coordinates. By including a fourth coordinate (commonly called w and
set to the value 1), this makes it possible for geometric transformations
(such as translation, rotation, scaling, and projection) to be represented
by and calculated using a single matrix, which will be discussed in detail
in Chapter 3.
As indicated at the beginning of this section, the current goal is to write
a vertex shader and a fragment shader that will render a single point on
the screen. Te code presented will avoid the use of bufers and exclusively
use built-in variables. (You do not need to create any new fles or enter any
code at this time.) Te vertex shader will consist of the following code:
void main()
{
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
}
void main()
{
gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
}
36 ◾ Developing Graphics Frameworks with Python and OpenGL
For more modern versions of OpenGL, where you need to declare a vari-
able for the output color, you can use the following code for the fragment
shader:
Taken together, the vertex shader and the fragment shader produce a
program that renders a point in the center of the screen, colored yellow. If
desired, these values can be altered within certain bounds. Te x, y, and z
components of the position vector may be changed to any value between
−1.0 and 1.0, and the point will remain visible; any values outside this range
place the point outside of the region rendered by OpenGL and will result
in an empty image being rendered. Changing the z coordinate (within this
range) will have no visible efect at this time, since no perspective trans-
formations are being applied. Similarly, the r, g, and b components of the
color vector may be changed as desired, although dark colors may be dif-
fcult to distinguish on the default black background color. It should also
be noted that the number types int and float are not interchangeable;
entering just 1 rather than 1.0 may cause shader compilation errors.
glCreateShader( shaderType )
Creates an empty shader object, which is used to store the source code of
a shader, and returns a value by which it can be referenced. Te type of
shader (such as a vertex shader or a fragment shader) is specifed with
the shaderType parameter, whose value will be an OpenGL constant
such as GL_VERTEX_SHADER or GL_FRAGMENT_SHADER.
glShaderSource( shaderRef, shaderCode )
Stores the source code in the string parameter shaderCode in the shader
object referenced by the parameter shaderRef.
glCompileShader( shaderRef )
Compiles the source code stored in the shader object referenced by the
parameter shaderRef.
Since mistakes may be made when writing shader code, compiling a shader
may or may not succeed. Unlike application compilation errors, which are
typically automatically displayed to the programmer, shader compila-
tion errors need to be checked for specifcally. Tis process is typically
handled in multiple steps: checking if compilation was successful, and if
not, retrieving the error message, and deleting the shader object to free up
memory. Tis is handled with the following functions:
glGetShaderInfoLog( shaderRef )
Returns information about the compilation process (such as errors and
warnings) from the shader referenced by the parameter shaderRef.
glDeleteShader( shaderRef )
Frees the memory used by the shader referenced by the parameter
shaderRef, and makes the reference available for future shaders that
are created.
@staticmethod
def initializeShader(shaderCode, shaderType):
if not compileSuccess:
# retrieve error message
errorMessage = glGetShaderInfoLog(shaderRef)
# free memory used to store shader program
glDeleteShader(shaderRef)
# convert byte string to character string
errorMessage = '\n' + errorMessage.
decode('utf-8')
# raise exception: halt program and print
error message
raise Exception( errorMessage )
glCreateProgram( )
Creates an empty program object, to which shader objects can be
attached, and returns a value by which it can be referenced.
glLinkProgram( programRef )
Links the vertex and fragment shaders previously attached to the pro-
gram object specifed by the parameter programRef. Among other
things, this process verifes that any variables used to send data from
the vertex shader to the fragment shader are declared in both shaders
consistently.
Another Random Scribd Document
with Unrelated Content
of her future. He must find just the right thing for her. "I know, of course,
that you wish to become self-supporting as soon as possible," he said. "Will
you tell me a little more about yourself and your capabilities? You came to
Benham a few months before your marriage to fit yourself to be a
kindergarten teacher, if I remember aright?"
During the momentary pause which preceded this inquiry her conscience
had been reasserting itself. She had longed for counsel and here it was. If
she had erred, there was yet time to repair her fault. "Before we talk of that,
may I ask you one question, Mr. Prentiss? I wish to know if you think it was
selfish of me to keep both the children. I desire to do what is right this time,
whatever it cost me." She clasped her hands resolutely in her lap as though
she were nerving herself for a sacrifice. "I hope you will tell me exactly
what you think."
Constance dropped her eyes to hide the tears of satisfaction which had
sprung into them at his words. Her children were safe. The counsel given
was the very echo of the test by which she had justified herself toward
Emil. "Excuse me," she said in apology for her emotion. Then looking up
she added with tremulous brightness, "I felt that I must be sure before
anything else was decided. And now to answer your question as to my own
capabilities: I have none. I am eager to learn, and I have had some
education—my father was fond of books and had a library—but I tell you
frankly that there is nothing but the simplest manual work for which I am
fitted at the present time. I have thought that all over."
"So far so good. Much of the trouble of this world proceeds from the
inability of people to discern for what they are not fitted. Can you sew?"
VII
Two days later the Rev. George Prentiss dined at the house of another of
his parishioners, Mrs. Randolph Wilson. She was a widow of about forty-
five, the sister of Carleton Howard, reputedly the wealthiest and most
sagacious of Benham's financial magnates, and a generous benefactress of
St. Stephen's. Her bounty had enabled the rector from time to time to carry
out his cherished plans for the æsthetic adornment of the church property.
The reredos, two stained-glass windows, and the baptismal font in the
enlarged edifice had been provided by her; and in the matter of charity she
never failed to respond by munificent subscriptions to the various causes in
aid of which he appealed to his congregation. They were friends and allies;
interested mutually in St. Stephen's, and interested also, as they both liked
to feel, in promoting American civilization outside of church work. Her
house, or palace, as it should more properly be termed, a counterpart to that
of her brother's which adjoined it, stood in the van of progress, in Benham's
fashionable new quarter beyond the River Drive. No pains or expense had
been spared to make these mansions impressive and magnificent. Architects
of repute had been employed to superintend their construction, and their
decorations and furnishings had been chosen in consultation with persons
whose business it was to know the whereabouts of admirable objects of art,
and to tempt impecunious noble families abroad to exchange their unique
treasures for dazzling round sums of American gold.
For Benham's evolution had been no mere growth of bricks and mortar,
and no mere triumph in census figures over other centres of population.
Even more remarkable and swift than its physical changes had been the
transformation in the point of view of its citizens. Twenty years earlier—in
1870, when Mr. Prentiss was a young man just starting in the ministry—he
had been one of a small group of earnest souls interested in awakening the
public to a consciousness of the paucity of their æsthetic interests, and to
the value of color as a stimulating factor in the every-day life of the
community, and as such he had often deplored the aridity of Benham's point
of view. In those days the city was virtually a hot-bed of republican
simplicity and contempt for social refinements so far as all but a very small
percentage of the inhabitants was concerned. Those who built houses larger
and finer than their neighbors were few in number and were stigmatized, if
not as enemies of the institutions of the country, as purse-proud and
frivolous. Hotels were conducted on the theory that what was good enough
for the landlord was good enough for the guest, and that malcontents could
go elsewhere. In matters appertaining to art, hygiene, education or
municipal management, one man's opinion was regarded as equal to any
other's, provided he could get the job. Special knowledge was sneered at,
and the best patriots in the public estimation were those who did not distrust
the ability of the average citizen to produce masterpieces in the line of his
or her employment by dint of raw genius untrammelled or unpolluted by the
experience of older civilizations. Though solid business men wore solemn-
looking black frock-coats and black wisp ties in business hours, to dress
again in the evening was looked at askance as undemocratic. It would have
been considered an invasion of the rights of the free-born citizen to forbid
expectoration in the street cars. Suggestions that the vicious and
unregenerate adult pauper poor should not be herded with the young, that
busy physicians should cleanse a lancet before probing a wound, and that
sewage should not be emptied into a river used as a source of water supply,
were still sniffed at by those in charge of public affairs as aristocratic
innovations unworthy the attention of a sovereign people. Architectural
beauty both within and without the house was disregarded in favor of
monotonous sober hues and solid effects, which were deemed to be
suggestive of the seriousness of the national character.
And yet there was another side to this whole matter which had haunted
Mr. Prentiss much of late, and which was in his thoughts to-night as he sat
smoking his cigar after dinner. He had dined sumptuously. Cool oysters,
soup of mushrooms, fish smothered in a luscious sauce, cutlets of venison
with French beans, little pyramids of paté de foie gras encased in jelly,
butter-ball ducks with a salad richly dressed, and a confection of fruit,
cream, and pastry, which was evidently a gastronomic specialty of Mrs.
Wilson's French cook. He had tasted everything; he had drunk two glasses
of champagne, and been pleasantly aware that the cup of black coffee,
served after dinner, was an entrancing concoction which his own kitchen
did not afford; and he felt that his repast had done him good. It was for him
an occasion. Obviously it was for Mrs. Wilson an every-day affair.
Moreover, this rich, delicious dinner, served by noiseless servants on choice
china, was in harmony with the rest of the magnificent establishment, in
harmony with the artistic scheme of color, the soft lustrous draperies, the
striking pictures and other masterpieces of art purchased for large sums
abroad, and Mrs. Wilson's beautiful toilette and exquisite personality. Here
was luxury triumphant and compelling, yet unappeased and seeking fresh
opportunities for æsthetic delight; as witness a Millet, an inlaid table, and a
Japanese idol in the room in which he sat, all new since he had dined there
last.
What a vivid contrast all this to the cheerless often squalid homes which
he was accustomed to visit as a rector of Christ's church! The thought which
haunted him was that one result of the city's marvellous growth and
development had been the accentuation of the distinctions between rich and
poor, between class and class in a community where, until lately, there had
been theoretically no classes. To be sure he had Mr. Carleton Howard's
assertion that there was no country in the world where the poor man was so
well off. This was very likely true, but it did not affect the proposition that
the rich were daily growing richer and more self-indulgent. What was to be
the limit—the outcome of this renaissance of beauty and comfort, which he
had welcomed? Had not the æsthetic reaction almost reached the point
where, both as a priest of God and as a good American, it behooved him to
cry halt against luxury and extravagance? He frowned at this last reflection
for the reason that he was painfully aware that he had fulminated against
this sort of thing from the pulpit for years, formerly as part of the clerical
formula championing the cause of the spirit against the flesh, and latterly
because the Aladdin-like growth of great fortunes all over the land, and
conspicuously in his own community, had often suggested the comparison
between the passage of a camel through the eye of a needle and the rich
man's entrance into the kingdom of heaven as an appropriate text. He had
spoken with fervor and sincerity concerning the responsibilities of those
having great possessions, and sometimes with living pictures in his mind.
Neither Mrs. Wilson nor her brother had ever been among those for whom
these admonitions were intended. They had opened their purse-strings
liberally to every meritorious cause. The goodly size of their cheques was to
him a constant source both of satisfaction and astonishment—astonishment
at the new possibilities open to those interested in God's kingdom.
Yet, though he put from him as ungenerous and unnecessary any positive
criticism of his hostess, in the teeth of her many benefactions and her
personal activity in social undertakings, he could not help realizing that, in
spite of his utterances, the evil which he deprecated was proceeding at a
pace which suggested the course of wild-fire. And the worst of it was that
he—the church—was so helpless. Great fortunes had been accumulated
with a zeal which suggested the inevitable march of destiny—a law which
seemed almost to mock the spirit of Christ—and, even while he was
musing, the city had become a theatre of industrial contrasts, with the pomp
and pride of life in the centre of the stage and poverty and distress in the
ample background. There recurred to him the traditional image of the curate
of his faith—the Church of England—cringing before or patronized by the
titled worshippers of Mammon. This, at least, he could resent as impossible
in his case—he had never hesitated to speak his mind to any of his
parishioners, however important—still, the reminder was disconcerting and
a challenge to his conscience. Nor was the reflection that this wave of
luxury, this more and more exacting reverence for material comforts, was a
part of the movement of the century, and was common to all civilized
countries, a solace. He was an American, but first of all, he was a servant of
the church, and the church was the beacon of civilization. Was she doing
her work, if these terrible inequalities were to continue? What was to be the
outcome of this zest for luxurious personal comfort?
Mr. Prentiss sometimes sighed over these limitations, but he had become
used to them, and in a measure, with advancing years, he had, in his
endeavor to be a man of the world in order to remain a more useful
Christian, accepted the doctrine that he had no plan to substitute for the
present economic system, and that he must make the best of the existing
situation. So, in practical, daily life, he exhorted the rich to give their
money and themselves to the advancement of their fellow men, and the
poor to shun vice and bear their privations with patience, while he held
forth the promise of the church of an existence hereafter for the pure in
heart where all the seeming inconsistencies of this mortal life would be
explained and justified. Not being endowed with much sense of humor, Mr.
Prentiss, as he waxed in years, and St. Stephen's became the fashionable
church of the city, had found less and less difficulty in accommodating
himself to this point of view, and in devoting all his ardor to reclaiming
souls for Christ. After all, was not his mission to help men and women as he
found them? First of all to minister to their souls, and in the name of
Christianity to lift them from the slough of human suffering and misfortune
that he might expound to them the loving mercies of the Lord? The things
of the earth were not the things of the spirit, and he was more tenacious
than in his youth of the prerogatives of the church as an institution
controlling human consciences by standards of its own, founded on the
teachings of the Prince of Peace. Nevertheless, being reasonably clear-
headed and fearless, he was not without the suspicion at times that this
reasoning was mystical, and in the face of facts he had every now and then
his unpleasant quarters of an hour.
This was one of them to-night. His hostess, when the dinner was over,
had left him to a cigar and his own devices in the library. He was to join her
presently and be shown her daughter's wedding presents. He had been
invited to dine in order that he might see them, but Mrs. Wilson and he both
knew that this was an excuse for a quiet evening together in which they
might compare notes concerning their mutual interests. Reaching out to
knock off the ash of his cigar into a dainty porcelain wheelbarrow, he
noticed a new photograph on the mantel-piece and rose to examine it. He
recognized it as one of Clarence Waldo, the New Yorker to whom Miss
Lucille Wilson was betrothed. The sight of this young man's countenance
did not serve to restore Mr. Prentiss's serenity. On the contrary, he stood
gazing at the photograph with an expression which suggested that his soul
was still perturbed. The face was that of a man of twenty-seven or eight
with delicate features—thin lips, a long nose and an indefinable haughtiness
of expression which was made up of weariness and disdain. He had large
eyes which lacked lustre, and his sparse hair gave the effect of having been
carefully brushed. The clergyman had met him only a few times, and Mr.
Prentiss had never forgotten the first occasion, which was at Lucille's
coming-out ball three years before. He had happened to find himself in Mr.
Waldo's path when the young man was in the act of carrying everything
before him with a plate of salad for his partner, and he had never forgotten
the cold impertinence of the New Yorker's stare. Paul Howard, Lucille's
cousin, who witnessed the encounter, said afterward that Clarence had
given Mr. Prentiss the dead eye, which was a telling description of the
stoniness of the fashionable New Yorker's gaze. Mr. Prentiss had never
heard this diagnosis, but he had remembered the episode. He regarded it,
however, merely as additional evidence of the lack of reverence on the part
of the young men of the day—and the young women, too, for the matter of
that—not merely for sacred things, but for everything and everybody which
were in their way or did not happen to appeal to their fancy. But though he
considered this absence of social politeness as one of the cardinal failings of
the age, his present thoughts regarding Lucille's future husband were not
concerned with it.
Since the engagement had been announced four months ago he had been
making inquiries, and the information which he had received was in his
mind and troubled his soul as a corollary of the other problems which had
just been haunting him. It was not of a character to justify him in forbidding
the bans—not even in remonstrating with Mrs. Wilson, unless she were to
ask his advice or provide him with an opportunity. But he deplored
sincerely that this young man was to marry his friend's daughter. Was this to
be the outcome, the crowning of the wealth of love and solicitude which
had been lavished on this only child—a child brought up in his church? Was
it for this that Lucille had been made the central figure of costly
entertainments for the last three years, in the hope that she might make a
brilliant match? Decidedly, it was a puzzling world, and circumstances
seemed to be conspiring to cloud his horizon and disturb his digestion at a
time when he ought to be enjoying himself and taking his ease.
VIII
Yet though his thoughts thus shaped themselves in fervent words, he was
conscious that in the absence of a cue his lips must remain sealed. There
was a limit imposed by society on the priestly office which he could not
overstep without appearing officious, and thus weakening his influence.
Were it a case of notorious dissipation or some palpable fault or blemish, it
would be his duty to speak. But he had no such data at his command.
Clarence Waldo was simply a fastidious idler, pretentious, and indifferent to
the vital interests of life. It could not even be charged that he was marrying
Lucille for her money, as he had a competency of his own. They would be
able to buy all the dogs and horses in the country if they saw fit. But his
own tongue was tied. To all appearances Mrs. Wilson was content. At the
time she had announced her daughter's engagement to him, she had said, in
response to his earnest inquiry if she were satisfied—said it with a blithe
smile, as though, on the whole, the best had happened—"I should have been
glad of course, if Lucille had chosen a man of conspicuous talent, a future
United States Senator or successful artist or author. If she had loved her
lord, I should not have objected to a title, because, after all, even to a free-
born American, there is a certain compensation in becoming the mother of
dukes and regenerating an ancient line. But Clarence is well connected, and
the child is in love with him. So long as she is happy, that is the essential
thing."
Mrs. Wilson was not in the drawing-room, but Mr. Prentiss caught a
glimpse of her at her desk in a smaller room which led out of it. She called
to him that she was answering a note and would join him presently. The
clergyman seated himself and picking up from a low teak table beside him a
paper-cutter fashioned on a Japanese sword hilt he compressed his fingers
on the handle as an outlet to his perplexity. Had he been walking in the
fields, he would have cut off the heads of the dandelions with his cane.
Marriage was a sacrament, the most solemn undertaking in life, yet how
impossible it was to regulate matrimony for others. He glanced around the
room admiringly. Already the musical notes of his hostess's voice had
served to dissipate partially the miasma of doubt which had been assailing
him. This main apartment was one of a series of drawing-rooms, each
furnished with an exquisite magnificence suggestive of the salons of France
in the days of Louis XIV, save that there was a superabundance of artistic
furnishings; hence the sight was confused by the array of costly tapestries,
marbles, bronzes, china, and gilt or otherwise illuminated ornaments which
almost contended for space with one another, though the rooms were of
large proportions. One feature of Benham's renaissance was the ambition to
outdo the past in size and gorgeousness, but Mrs. Wilson's advisers had
been animated also by the desire for artistic success, and it was only in its
wealth of material that their and her—for she had been the leading spirit
after all—performance was open to criticism. Here in Benham, where
twenty years before the horse-hair sofa was still an object of admiring
regard in the homes of the well-to-do, the desert had blossomed with the
rose, and a veritable palace had been established. And, as Mr. Prentiss
reflected, joining his finger-tips across his waist-band, all this lavish
expenditure meant the return by the rich of accumulated wealth into
circulation for the benefit of those who labored for their bread, which was
another of Mr. Carleton Howard's telling truths.
The swift, animated, but noiseless glide of Mrs. Wilson into the room
and onto a sofa, from which she flashed at him a gracious, electric look of
attention with the words, "And now, my friend, I am entirely at your
disposal. It was a note which had to be answered at once"—restored Mr.
Prentiss's serenity. She was one of those pleasant persons in whose presence
the world seems justified. When she entered a room people were apt to pay
tribute by a pause in whatever they were doing, and she became the focus of
attention. The effect of her graceful energy was largely responsible for this,
suggesting the forceful but silent sweep of a ship. She had lost the figure
and the countenance of youth, but though her abundant crinkly hair was
grizzled no one ever thought of her age except to observe that she was
handsomer than as a younger woman. She had never been a beauty; she was
now a distinguished looking, comely, and effective matron. She was tall and
rather willowy, but not thin, with a proud, resolutely carried head, an
agreeable straight nose, short rather than long (her best feature) a spirited,
sympathetic smile, eyes fundamentally gray, which changed as her thoughts
changed, and ingratiating but elegant manners. Her face, notably the cheeks
and lips, was a trifle full, suggesting dimples, and possibly to the critical a
too-manifest desire to please. Her obvious pose—which, though deliberate
was entirely genuine—was to be exquisite, sympathetic, and intellectual,
and for the expression of this range of qualities she had serviceable allies in
her musical voice, a bewitching way of showing just enough of her teeth,
when she became vivacious, and her ornamental clothes, which always
suited her. On this evening she wore an old-gold gown with jet and lace
accompaniments, an aigrette of crimson gauze with which the plumage of
her fan was in harmony, a band of magnificent pearls around her neck, and
on her breast, though such ornaments were not strictly in fashion, a large
brooch of fine workmanship containing a miniature of two children of
tender age. Of these children one had died shortly after the miniature was
painted, the other was her daughter Lucille. Her soul was dedicated to two
interests, her joy and ambition as a mother, and to the cause of social human
progress.
Mrs. Wilson had been for fifteen years a widow, and, though her
husband held a hallowed place in her heart, even she was conscious that the
broad scope of her present life dated from the period when, seeking a refuge
from her own grief and loneliness, she had welcomed diverse social
employment. Her husband, Randolph, a hero and a colonel of the Civil War,
had claimed her on his return as a bride. They were ardent lovers, and they
had never ceased to be so, certainly not in theory. Some of Mrs. Wilson's
knowing friends were fond of insinuating, when the humor for gossip
prevailed, that he had died just in time, which was their way of intimating
that she had outgrown him. But these dissectors of hearts did not perhaps
sufficiently remember that her own blossoming forth into the woman she
now was had been subsequent to her husband's death. Nor did they take
sufficiently into account the bewildering course of events which had
attended her progress. Colonel Wilson, a man of small means at the time of
their marriage, had become her brother's partner. The properties in which he
was interested at the time of his death had subsequently proved so valuable
that she had found herself presently the possessor of a million, a sum which
had quadrupled in the keeping of her brother, Carleton Howard, one of the
most powerful financiers in the country. Opportunity surely had waited on
her widening aspirations, enabling her finally to establish herself in this
magnificent home surrounded by all the æsthetic attractions and many of
the treasures of modern civilization.
Probably Mrs. Wilson herself had never sought to analyze the past by the
light of the present, realizing, as we all do, that life unbeknown to us has
halting-places which become, as we look back, the dividing lines between
what are almost separate existences. Though at her husband's death she had
made no resolutions regarding the future, she had never felt the impulse to
marry again, so engrossing were the concerns of motherhood and social
responsibility.
"Ah, yes." Mr. Prentiss was glad to have this recalled to his mind. There
was no chance here for doubt or perplexity. "It is rather out of the usual run
of charity cases. The personality of the woman, I mean. The circumstance
that her husband has run away and left her penniless, with two young
children to support is, alas! only too common."
"She sounds interesting, and I do not see that she has been to blame. We
must raise a fund for her. With how large a subscription shall I head the
list?" Though Mrs. Wilson gave freely on merely charitable grounds, she
gave with more enthusiasm when the objects of her bounty had not
offended her sense of the social fitness of things.
The clergyman put out his hand. "That wouldn't do exactly, I think. She
is not too proud to let us help her for a few weeks with coal and groceries
until she can earn for herself. She realizes that she must be sensible, if only
for the children's sake. She has an independent simplicity of nature and
clearness of perception which would stand in the way, I fear, of her
accepting a donation such as you have in mind; though I should dearly love
to allow you to pay off the encumbrances on their house, which, owing to
her husband's rascalities have eaten up her little home—her patrimony. But
I am sure she would refuse."
"Always. The shiftless, dirty, unaspiring, unæsthetic poor. The dregs and
lees of human endeavor. We must feed and clothe them, of course, and help
them to help themselves, but sometimes I forget the pathos of it all in the
ugliness and squalor. Consequently, when the chance to do real good
comes, it is a pity not to be able to lift the burden completely. What, then,
can I do for this young person?"
"I have thought over her case for the last forty-eight hours, and have
come to the conclusion that, as she has no special training, her best chance
for employment is to learn short-hand and to use the typewriter. I
understand that women proficient in this vocation can usually secure steady
work at a fair wage. Though Mrs. Stuart would be unwilling to accept a
direct gift of money, I feel confident that she would not refuse to let us put
her in the position to become self-supporting—that is, defray the cost of the
lessons necessary to make her a competent stenographer or office clerk.
And I thought you might be glad to pay for these lessons—a matter of six
months or so."
Mr. Prentiss had taken up the paper-cutter again, and he passed the flat
of the metal blade across his palm as though he were smoothing out his plan
as well as the creases.
"Gladly," she responded. "For as long as you desire. And, perhaps, when
she has learned what is necessary, my brother may know of some opening
for her down-town."
"And, in the meantime, since you tell me that she is competent and
refined, my secretary, who will have her hands full with the details of the
wedding, may be able to give her occasional errands to do. You may tell her
to call when her plans are adjusted and to ask for me."
"Come," she said, rising, "I will show you the presents. Only think, four
hundred of them, and so many beautiful things! People have been so kind.
Several of my brother's friends in New York have sent most exquisite
tokens—a necklace of diamonds and pearls from Mr. Fenton the banker, a
gold dessert service from his railroad ally, Mr. Kennard."
She led the way from the drawing-room suite into the hall, where
electricity in artistic guises illuminated the broad panellings, a splendid
Terriers and three or four bronze or marble statuaries of rare merit, and up
the stair-case to the next floor into what was known as the morning-room—
an apartment where Mrs. Wilson conducted her affairs and did her reading
and thinking. This was a combination of study and æsthetic boudoir. There
were seductive sofas and quaint capacious chairs supplied with brightly
colored cushions, and dainty draperies, all in silken stuffs of patterns
reminiscent of the Orient. Art, in its most delicate and spiritual forms,
breathed from every object of furniture or decoration; from the small
pictures—some in oils, some in water-colors—which merited and often
demanded the closest scrutiny; from the few vases of entrancing shape and
hue, from the interesting photographs in beautiful frames, from the curious
and rare memorials of travel and wise choice of what cunning fingers had
wrought with infinite labor. As in the rest of the house, there was still too
much wealth of material, too much scintillation and conglomeration of
color, but the intent had been—and not without success—to produce a more
subtle atmosphere than prevailed outside, as of an inner temple. Prominent
in one angle stood Mrs. Wilson's desk, rose-wood, inlaid with poetic gilt
tracery, and littered with the correspondence of a busy woman. Books and
other articles of daily use lying here and there without effort at order gave
to the room the air of being the intimate abode of a human soul. Opening
out of this was a private music-room, which was used by Mrs. Wilson and
her daughter in preference to the large music-room on the street floor
intended for musical parties and dances. Here were the wedding presents, a
dazzling array of gold, silver, jewels, glass, china, and ornamental knick-
knacks, tastefully arranged on tables introduced for the purpose. As they
entered an attendant withdrew into the hall.
"And yet," interposed Mrs. Wilson, as she singled out an enchanting fan
of gold and ivory and the most exquisite lace and spread it for his
inspection, "why should I pander to the vulgar curiosity of the public? It is
none of their business."
"In a matter of this kind I quite agree with you. If they could see all these
beautiful things, there might be some sense in it; but that would be out of
the question, of course."
"That will be the next step; our houses thrown open to the madding
crowd. Six newspapers—two from New York—applied recently for leave to
see the presents. I intended to refuse firmly, but to my astonishment Lucille
seemed disappointed. It never occurred to me that she would not hate the
publicity. She gave a little shriek and said, 'Mamma, how dreadful!' and
then added in the next breath, 'Everybody does it, and, as something is sure
to be printed, might it not be better to make certain that it's correct?' A day
or two later she was photographed in her tiara, and from what has transpired
since I fear that the idea of publicity was not foreign to her thought. My
child, Mr. Prentiss! Only think of it! One can never quite understand the
point of view of the rising generation. I consulted Carleton, and he grew
successively irate, contemplative, philosophical, and weak-kneed. In short,
a week ago a reportorial woman, with the social appetite of a hyena and the
keen-eyed industry of a ferret, passed the forenoon in the house and went
away with a photograph of Lucille in the tiara. And what is worst of all, in
spite of my humiliation at the whole proceeding, I am decidedly curious to
see what she has written."
ebookball.com