Computer Graphics Programming in OpenGL with Java 2nd Edition V. Scott Gordon all chapter instant download
Computer Graphics Programming in OpenGL with Java 2nd Edition V. Scott Gordon all chapter instant download
com
https://textbookfull.com/product/computer-graphics-
programming-in-opengl-with-java-2nd-edition-v-scott-gordon/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/computer-graphics-programming-in-
opengl-with-java-gordon/
textboxfull.com
https://textbookfull.com/product/computer-graphics-programming-in-
opengl-using-c-third-edition-gordon-phd/
textboxfull.com
https://textbookfull.com/product/computer-graphics-through-opengl-
third-edition-guha/
textboxfull.com
https://textbookfull.com/product/introduction-to-computer-graphics-
with-opengl-es-first-edition-junghyun-han/
textboxfull.com
OpenGL Programming Guide The Official Guide to Learning
OpenGL Version 4 5 with SPIR V 9th Edition Kessenich
https://textbookfull.com/product/opengl-programming-guide-the-
official-guide-to-learning-opengl-version-4-5-with-spir-v-9th-edition-
kessenich/
textboxfull.com
https://textbookfull.com/product/learn-opengl-learn-modern-opengl-
graphics-programming-in-a-step-by-step-fashion-1st-edition-joey-de-
vries/
textboxfull.com
https://textbookfull.com/product/computer-graphics-through-opengl-
from-theory-to-experiments-sumanta-guha/
textboxfull.com
https://textbookfull.com/product/java-performance-in-depth-advice-for-
tuning-and-programming-java-8-11-and-beyond-2nd-edition-scott-oaks/
textboxfull.com
https://textbookfull.com/product/computer-graphics-for-java-
programmers-3rd-edition-leen-ammeraal/
textboxfull.com
Computer Graphics
Programming in OpenGL
with Java
Second Edition
By purchasing or using this book and its companion files (the “Work”), you agree
that this license grants permission to use the contents contained herein, but does
not give you the right of ownership to any of the textual content in the book or
ownership to any of the information or products contained in it. This license does
not permit uploading of the Work onto the Internet or on a network (of any kind)
without the written consent of the Publisher. Duplication or dissemination of any
text, code, simulations, images, etc. contained herein is limited to and subject to
licensing terms for the respective products, and permission must be obtained from
the Publisher or the owner of the content, etc., in order to reproduce or network any
portion of the textual material (in any media) that is contained in the Work.
The author, developers, and the publisher of any accompanying content, and anyone
involved in the composition, production, and manufacturing of this work will not
be liable for damages of any kind arising out of the use of (or the inability to use)
the algorithms, source code, computer programs, or textual material contained in
this publication. This includes, but is not limited to, loss of revenue or profit, or
other incidental, physical, or consequential damages arising out of the use of this
Work.
The sole remedy in the event of a claim of any kind is expressly limited to
replacement of the book and disc and only at the discretion of the Publisher. The
use of “implied warranty” and certain “exclusions” vary from state to state, and
might not apply to the purchaser of this product.
Companion files are available for download from the publisher by writing to
info@merclearning.com.
This publication, portions of it, or any accompanying software may not be reproduced in any way,
stored in a retrieval system of any type, or transmitted by any means, media, electronic display or
mechanical display, including, but not limited to, photocopy, recording, Internet postings, or scan
ning, without prior permission in writing from the publisher.
The publisher recognizes and respects all marks used by companies, manufacturers, and
developers as a means to distinguish their products. All brand names and product names mentioned
in this book are trademarks or service marks of their respective companies. Any omission or misuse
(of any kind) of service marks or trademarks, etc. is not an attempt to infringe on the property
of others.
Our titles are available for adoption, license, or bulk purchase by institutions, corporations, etc.
For additional information, please contact the Customer Service Dept. at 800-232-0223 (toll free).
Digital versions of our titles are available at: www.authorcloudware.com and other e-vendors. All
companion files are available by writing to the publisher at info@merclearning.com.
The sole obligation of Mercury Learning and inforMation to the purchaser is to replace the book
and/or disc, based on defective materials or faulty workmanship, but not based on the operation or
functionality of the product.
Index 371
One of the things that we hope is unique about this book is that we have strived to make
it accessible to a beginner—that is, someone new to 3D graphics programming. While
there is by no means a lack of information available on the topic—quite the contrary—
many students are initially overwhelmed. This text is our attempt to write the book we
wish we had had when we were starting out, with step-by-step explanations of the basics,
progressing in an organized manner up through advanced topics. We considered titling
the book Shader Programming Made Easy; however, we don’t think that there really is
any way of making shader programming “easy.” We hope that we have come close.
This book teaches OpenGL programming in Java, using JOGL—a Java “wrapper”
for OpenGL’s native C calls [JO16]. There are several advantages to learning graphics
programming in Java rather than in C:
• It is more convenient for students at schools that conduct most of their curriculum
in Java.
• Java’s I/O, window, and event handling are arguably cleaner than in C.
• Java’s excellent support for object-oriented design patterns can foster good design.
• JOGL includes some very nice tools, such as for loading textures, animation
loops, etc.
It is worth mentioning that there do exist other Java bindings for OpenGL. One that
has become very popular is Lightweight Java Game Library, or LWJGL [LW16]. Like
JOGL, LWJGL also offers bindings for OpenAL and OpenCL. This textbook focuses
only on JOGL.
Another thing that makes this book unique is that it has a “sister” textbook: Computer
Graphics Programming in OpenGL with C++. The two books are organized in lockstep,
with the same chapter and section numbers and topics, figures, exercises, and theoretical
descriptions. Wherever possible, the code is organized similarly. Of course, the use of
Java versus C++ leads to considerable programming differences. Still, we believe that we
have provided virtually identical learning paths, even allowing a student to choose either
option within a single classroom.
An important point of clarification is that there exist both different versions of OpenGL
(briefly discussed later) and different variants of OpenGL. For example, in addition to
“standard OpenGL” (sometimes called “desktop OpenGL”), there exists a variant called
“OpenGL ES” which is tailored for development of embedded systems (hence the “ES”).
“Embedded systems” include devices such as mobile phones, game consoles, automo-
biles, and industrial control systems. OpenGL ES is mostly a subset of standard OpenGL,
eliminating a large number of operations that are typically not needed for embedded sys-
tems. OpenGL ES also adds some additional functionality, typically application-specific
operations for particular target environments. The JOGL suite of Java bindings includes
interfaces for different versions of OpenGL ES, although we do not use them in this book.
Yet another variant of OpenGL is called “WebGL.” Based on OpenGL ES, WebGL is
designed to support the use of OpenGL in web browsers. WebGL allows an application to
use JavaScript1 to invoke OpenGL ES operations, which makes it easy to embed OpenGL
graphics into standard HTML (web) documents. Most modern web browsers support
WebGL, including Apple Safari, Google Chrome, Microsoft Internet Explorer, Mozilla
Firefox, and Opera. Since web programming is outside the scope of this book, we will not
cover any WebGL specifics. Note however that because WebGL is based on OpenGL ES,
which in turn is based on standard OpenGL, much of what is covered in this book can be
transferred directly to learning about these OpenGL variants.
The very topic of 3D graphics lends itself to impressive, even beautiful images.
Indeed, many popular textbooks on the topic are filled with breathtaking scenes, and it
is enticing to leaf through their galleries. While we acknowledge the motivational utility
1 JavaScript is a scripting language that can be used to embed code in webpages. It has strong
similarities to Java, but also many important differences.
of such examples, our aim is to teach, not to impress. The images in this book are simply
the outputs of the example programs, and since this is an introductory text, the resulting
scenes are unlikely to impress an expert. However, the techniques presented do constitute
the foundational elements for producing today’s stunning 3D effects.
The switch to JOML affects virtually every program in the book, although in most
cases the changes are small. Readers who have used our previous edition will find that
their existing code may not work without updating the code (and the library) to JOML.
We hope that any minor inconvenience will be offset by improved performance and the
benefits of standardization to a more widely used library.
As we did for graphicslib3D in our previous edition, we have included the latest ver-
sion of JOML on the companion disc distributed with this book. However, readers are
encouraged to seek out and utilize the newest version of JOML as it is being continually
updated. For this reason, our installation instructions describe how to obtain the latest
version of JOML from the Internet.
There are some new sections in the book that we hope readers will find exciting. As
alluded to above, we have added a section on coding for performance. We also added a
section on generating soft shadows that we promised in the instructor notes for our previ-
ous edition. The techniques for soft shadows also help with reducing jagged-edge shadow
artifacts, and so users are likely to use them frequently, even when soft shadows aren’t
necessary. We also added a new section in Chapter 13 (on geometry), showing how to
generate hair or fur by using a geometry shader to change primitive types.
Almost immediately after our first edition was released, we were asked how to run
the programs on a Macintosh. After getting all of our examples running on a Mac, we pub-
lished the steps on our website. That information has become an additional appendix in
this edition. In fact, for this edition, we have moved all installation details into appendices.
We also added an appendix on using NVIDIA’s Nsight graphics debugger. The first
time we saw this tool we were blown away and desperately wanted to include it in our
book. Nsight was developed for use with C++, but after some experimentation—and some
much appreciated help from NVIDIA—we were able to get it to work with Java/JOGL.
We are delighted to include it in this second edition.
Intended Audience
This book is targeted at students of computer science. This could mean undergraduates
pursuing a BS degree, but it could also mean anyone who studies computer science. As
such, we are assuming that the reader has at least a solid background in object-oriented
programming, at the level of someone who is, say, a computer science major at the junior
or senior level.
There are also some specific things that we use in this book but don’t cover because
we assume the reader already has sufficient background, including the following:
• Java and its Abstract Window Toolkit (AWT) or Swing library, especially for
GUI-building
• Java configuration details, such as manipulating the CLASSPATH
• event-driven programming
• basic matrix algebra and trigonometry
• awareness of color models, such as RGB, RGBA, etc.
The audience for this new second edition is also hoped to be expanded by the release
of its “sister” textbook, Computer Graphics Programming in OpenGL with C++. In par-
ticular, we envision the possibility of a learning environment where students are free to
utilize either Java or C++ in the same classroom, selecting one or the other book. The two
texts cover the material sufficiently in lockstep that we believe conducting a course in this
manner should be possible.
This book is intended mostly as a practical, hands-on guide. While there is plenty of
theoretical material included, the reader should treat this text as a sort of “workbook,” in
which you learn basic concepts by actually programming them yourself. We have pro-
vided code for all of the examples, but to really learn the concepts you will want to “play”
with those examples—extend them to build your own 3D scenes.
At the end of each chapter are a few problems to solve. Some are very simple, involv-
ing merely making simple modifications to the provided code. The problems that are
marked “(PROJECT),” however, are expected to take some time to solve and require writ-
ing a significant amount of code, or combining techniques from various examples. There
are also a few marked “(RESEARCH)” that encourage independent study because this
textbook doesn’t provide sufficient detail to solve them.
OpenGL calls, whether made in C or in Java through JOGL, often involve long lists of
parameters. While writing this book, the authors debated whether or not to, in each case,
describe all of the parameters. We decided that at the very beginning we would describe
every detail. But as the topics progress, we decided to avoid getting bogged down in every
piece of minutiae in the OpenGL calls (and there are many), for fear of the reader losing
sight of the big picture. For this reason, it is essential when working through the examples
to have ready access to reference material for Java, OpenGL, and JOGL.
For this, there are a number of excellent reference sources that we recommend using
in conjunction with this book. The javadocs for Java and JOGL are absolutely essential,
and can be accessed online or downloaded. The reader should bookmark them for easy
access in a browser, and expect to access them continuously for looking up items such
as parameter and constructor details. Use the following URLs for the Java and JOGL
javadocs:
https://docs.oracle.com/javase/8/docs/api/
https://jogamp.org/deployment/webstart/javadoc/jogl/javadoc
Many of the entries in the JOGL javadoc are simply pointers to the corresponding
entry in the OpenGL documentation:
https://www.opengl.org/sdk/docs/man/
Our examples utilize a mathematics library called JOML. This is a Java library that
also has its own set of javadocs. After installing JOML (described in the appendices), the
reader should locate the accompanying javadoc link and bookmark it. At press time, the
current link is
https://joml-ci.github.io/JOML/apidocs/
There are many other books on 3D graphics programming that we recommend read-
ing in parallel with this book (such as for solving the “research” problems), including the
following five that we often refer to:
• (Sellers et al.) OpenGL SuperBible [SW15]
• (Kessenich et al.) OpenGL Programming Guide [KS16] (the “red book”)
• (Wolff) OpenGL 4 Shading Language Cookbook [WO13]
• (Angel and Shreiner) Interactive Computer Graphics [AS14]
• (Luna) Introduction to 3D Game Programming with DirectX 12 [LU16]
Companion Files
This book is accompanied by a companion disc that contains the following items:
• All of the Java/OpenGL programs and related utility class files and GLSL shader
code presented in the book, along with batch files for compiling and running them
• The models and texture files used in the various programs and examples
• The cubemap and skydome image files used to make the skies and horizons
• Normal maps and height maps for lighting and surface detail effects
• All of the figures in the book, as image files
• The JOML mathematics library (version 1.9.11)
Readers who have purchased the electronic version of this book may obtain these files
by contacting the publisher at info@merclearning.com.
Instructor Ancillaries
Instructors in a college or university setting are encouraged to obtain the instructor ancil
lary package that is available for this book, which contains the following additional items:
• A complete set of PowerPoint slides covering all topics in the book
• Solutions to most of the exercises at the ends of the chapters, including code
where applicable
• Sample syllabus for a course based on the book
• Additional hints for presenting the material, chapter-by-chapter
This instructor ancillary package is available by contacting the publisher at info@
merclearning.com.
Acknowledgments
Early drafts of this book (prior to the first edition) were used in the CSc-155 (Advanced
Computer Graphics Programming) course at CSU Sacramento, and benefited from many
student corrections and comments (and in some cases, code). The authors would like to
particularly thank Mitchell Brannan, Tiffany Chiapuzio-Wong, Samson Chua, Anthony
Doan, Kian Faroughi, Cody Jackson, John Johnston, Zeeshan Khaliq, Raymond Rivera,
Oscar Solorzano, Darren Takemoto, Jon Tinney, James Womack, and Victor Zepeda for
their suggestions.
Feedback started coming in almost immediately after the first edition was published.
We were especially excited to hear from instructors who adopted the book for their
courses and shared their experiences. Dr. Mauricio Papa from the University of Tulsa
traded several useful emails with us. Sean McCrory prepared a wonderfully detailed set
of corrections to a couple of our lighting (Chapter 7) and Perlin noise (Chapter 14) imple-
mentations. We also heard from many students at various institutions, and their questions
helped us to assess strengths and weaknesses in our book.
A sort of “acid test” for our book came in the fall of 2017, when our colleague Dr. Pinar
Muyan-Ozcelik used the first edition while teaching our CSc-155 course for her first time.
This gave us an opportunity to assess whether our book achieved its goal as a “teach
yourself” resource. The course went well, and along the way Dr. Muyan-Ozcelik kept a
running log of questions and corrections for each chapter, which led to many improve-
ments in this second edition.
Kai Burjack, lead developer of the JOML math library, has been extraordinarily
generous with his time and assistance as we migrated from graphicslib3D to JOML. He
reviewed key segments of our book and gave us insight into some important aspects of
JOML. He also helped guide us in using JOML correctly.
We are extremely grateful for the ongoing assistance provided to us by Julien Gouesse,
engine support maintainer at JogAmp. Mr. Gouesse has provided technical information
on JOGL textures, cube maps, buffer handling, proper loading of shader source files, and
a variety of other topics. His help has led to significant improvements in our text.
Jay Turberville of Studio 522 Productions in Scottsdale (Arizona) built the dolphin
model shown on the cover and used throughout this book. Our students love it. Studio 522
Productions does incredibly high-quality 3D animation and video production, as well as
custom 3D modeling. We were thrilled that Mr. Turberville kindly offered to build such a
wonderful model just for these books.
We wish to thank a few other artists and researchers who were gracious enough
to allow us to utilize their models and textures. James Hastings-Trew of Planet Pixel
Emporium provided many of the planetary surface textures. Paul Bourke allowed us to
use his wonderful star field. Dr. Marc Levoy of Stanford University granted us permis-
sion to use the famous “Stanford Dragon” model. Paul Baker’s bump-mapping tutorial
formed the basis of the “torus” model we used in many examples. We also thank Mercury
Learning for allowing us to use some of the textures from Introduction to 3D Game
Programming with DirectX 12 [LU16].
Dr. Danny Kopec connected us with Mercury Learning and introduced us to its
publisher, David Pallai. Dr. Kopec’s textbook, Artificial Intelligence in the 21st Century,
inspired us to consider Mercury, and our telephone conversations with him were extremely
informative. We were deeply saddened by Dr. Kopec’s untimely passing, and regret that
he didn’t have the chance to see our book come to fruition.
Finally, we wish to thank David Pallai and Jennifer Blaney of Mercury Learning for
their continued enthusiasm for this project and for guiding us through the textbook pub-
lishing process.
Errata
If you find any errors in our book, please let us know! Despite our best efforts, this book
certainly contains mistakes. We will do our best to post corrections as soon as errors are
reported to us. Shortly after the publication of the first edition, we established a webpage
for collecting errata and posting corrections—the same webpage will continue to be used
for the second edition:
http://athena.ecs.csus.edu/~gordonvs/errata.html
The publisher, Mercury Learning, also maintains a link to our errata page. So if the URL
for our errata page should ever change, check the Mercury Learning website for the latest link.
Dr. John Clevenger has over forty years of experience teaching a wide variety of courses,
including advanced graphics, game architecture, operating systems, VLSI chip design,
system simulation, and other topics. He is the developer of several software frameworks
and tools for teaching graphics and game architecture, including the graphicslib3D
library used in the first edition of this textbook. He is the technical director of the ACM
International Collegiate Programming Contest, and oversees the ongoing development
of PC^2, the most widely used programming contest support system in the world.
Dr. Clevenger obtained his PhD at the University of California, Davis. He is also a
performing jazz musician and spends summer vacations in his mountain cabin.
References
[AS14]
E. Angel and D. Shreiner, Interactive Computer Graphics: A Top-Down Approach
with WebGL, 7th ed. (Pearson, 2014).
[JO16]
JogAmp, accessed July 2016, http://jogamp.org/
[KS16]
J. Kessenich, G. Sellers, and D. Shreiner, OpenGL Programming Guide: The
Official Guide to Learning OpenGL, Version 4.5 with SPIR-V, 9th ed. (Addison-
Wesley, 2016).
[LU16]
F. Luna, Introduction to 3D Game Programming with DirectX 12, 2nd ed.
(Mercury Learning, 2016).
[LW16] Lightweight Java Game Library (LWJGL), accessed July 2016, https://www
.lwjgl.org/
[SW15] G. Sellers, R. Wright Jr., and N. Haemel, OpenGL SuperBible: Comprehensive
Tutorial and Reference, 7th ed. (Addison-Wesley, 2015).
[WO13] D. Wolff, OpenGL Shading Language Cookbook, 2nd ed. (Packt Publishing,
2013).
■ ■ ■■■
Graphics programming has a reputation for being among the most challeng-
ing computer science topics to learn. These days, graphics programming is shader
based—that is, some of the program is written in a standard language such as Java
or C++ for running on the CPU and some is written in a special-purpose shader
language for running directly on the graphics card (GPU). Shader programming has
a steep learning curve, so that even drawing something simple requires a convoluted
set of steps to pass graphics data down a “pipeline.” Modern graphics cards are able
to process this data in parallel, and so the graphics programmer must understand the
parallel architecture of the GPU, even when drawing simple shapes.
The payoff, however, is extraordinary power. The blossoming of stunning virtual
reality in videogames and increasingly realistic effects in Hollywood movies can be
greatly attributed to advances in shader programming. If reading this book is your
entrée into 3D graphics, you are taking on a personal challenge that will reward you
not only with pretty pictures but with a level of control over your machine that you
never imagined was possible. Welcome to the exciting world of computer graphics
programming!
Using OpenGL with Java requires configuring several libraries. In this sec-
tion, we describe which libraries are needed, some common options for each, and
the option(s) that we will use throughout the book. Details on how to install and
configure these libraries for your specific platform can be found in the appendices.
Running the programs in this book requires the following languages and
libraries:
• Java
• OpenGL / GLSL
• JOGL
• JOML
It is likely that the reader will need to do a few preparatory steps to ensure
that each of these are installed and properly accessible on his or her system. In the
following subsections we briefly describe each of them; see the appendices for
details on how to install and/or configure them for use.
1.1.1 Java
Java was developed at Sun Microsystems in the early 1990s, and the first stable
release of a development kit (JDK) occurred in 1995. In 2010, Oracle Corporation
acquired Sun and has maintained Java since that time [OR16]. This book assumes
at least Java version 8, which was released in 2014.
In 2009, version 3.1 removed a large number of features that had been depre-
cated, to enforce the use of shader programming as opposed to earlier approaches
(referred to as “immediate mode”).1 Among the more recent features, version 4.0
(in 2010) added a tessellation stage to the programmable pipeline.
This textbook assumes that the user is using a machine with a graphics card
that supports at least version 4.3 of OpenGL. If you are not sure which version of
OpenGL your GPU supports, there are free applications available on the web that
can be used to find out. One such application is GLView, by a company named
“realtech VR” [GV16].
1.1.3 JOGL
JOGL is a set of OpenGL bindings (sometimes called a “wrapper”) which
provides a mechanism for invoking C-based OpenGL functions from Java code.
JOGL first appeared in 2003, published on the website Java.net. Since 2010 it has
been an independent open source project, part of a suite of Java bindings main-
tained by JogAmp [JO16], an online community of developers. JogAmp also main-
tains JOAL and JOCL, bindings for OpenAL and OpenCL, respectively. As new
versions of OpenGL and/or Java are released, new versions of JOGL are developed
to support continued compatibility. JogAmp also maintains a short online user’s
guide that includes valuable guidelines for installing and using JOGL efficiently
and effectively [JU16]. This book assumes at least version 2.3 of JOGL.
1.1.4 JOML
3D graphics programming makes heavy use of vector and matrix algebra. For
this reason, use of OpenGL is greatly facilitated by an accompanying function
library or class package to support common mathematical tasks. For example, the
popular OpenGL SuperBible [SW15] utilizes a C library called “vmath”; in this
book, we use a Java library called Java OpenGL Math Library, or JOML.
JOML provides classes and basic math functions related to graphics concepts,
such as vector, matrix, and quaternion. It also contains a variety of utility classes
for creating and using common 3D graphics structures, such as a stack for building
1 Despite this, many graphics card manufacturers (notably NVIDIA) continue to support
deprecated functionality.
hierarchical structures, perspective and look-at matrices, and a few basic shapes
such as a rectangle and a sphere.
JOML was conceived in mid-2015 by Richard Greenlees and is an open source
project currently being developed and maintained by Kai Burjack, who took over
the project shortly after its inception. While it is relatively new, it has enjoyed wide-
spread adoption because of its high-performance characteristics. JOML is specifi-
cally designed to maximize performance in an OpenGL render loop (animation).
The previous edition of this book utilized our own in-house Java mathematics
library called graphicslib3D. We hope that users of our earlier edition appreciate the
better support and performance of JOML.
References
■ ■ ■■■
OpenGL (Open Graphics Library) is a multiplatform 2D and 3D graphics API
that incorporates both hardware and software. Using OpenGL requires a graphics
card (GPU) that supports a sufficiently up-to-date version of OpenGL (as described
in Chapter 1).
On the hardware side, OpenGL provides a multistage graphics pipeline that is
partially programmable using a language called GLSL (OpenGL Shading Language).
On the software side, OpenGL’s API is written in C, and thus the calls are directly
compatible with C and C++. However, stable language bindings (or “wrappers”) are
available for more than a dozen other popular languages (Java, Perl, Python, Visual
Basic, Delphi, Haskell, Lisp, Ruby, etc.) with virtually equivalent performance. This
textbook uses the popular Java wrapper JOGL (Java OpenGL). When using JOGL,
the programmer writes a Java program that runs on the CPU (more specifically, on
the Java Virtual Machine, or JVM) and includes JOGL (and thus, OpenGL) calls. We
will refer to a Java program that contains JOGL calls as a Java/JOGL application.
One important task of a Java/JOGL application is to install the programmer’s GLSL
code onto the GPU.
An overview of a JOGL-based graphics application is shown in Figure 2.1, with
the software components highlighted in pink.
1. It uses Java to obtain the GLSL shader code, either from text files or
hardcoded as strings.
(1,0,0,1), corresponding to the RGB values of the color red, plus a “1” for the opac-
ity component. We then use the OpenGL call glClear(GL_COLOR_BUFFER_BIT) to
actually fill the color buffer with that color.
Barlow could not but maintain that the decrees were repealed;
yet the British government could hardly be required to hold the
same opinion. Taking Bassano’s report as proof that the United
States would no longer maintain the repeal, the Prince Regent
issued, April 21, 1812, a formal declaration, that in case those
decrees should at any future time by an authentic act publicly
promulgated be expressly and unconditionally repealed, then the
Orders in Council should be wholly and absolutely revoked. This step
brought matters to a crisis. As soon as the Prince Regent’s
declaration reached Paris, May 1, 1812, Barlow wrote to the French
government a letter declaring that, between Bassano’s report and
the Prince Regent’s declaration, proof that the decrees were
repealed had become absolutely necessary for the United States,
and he followed up his notes by a conversation in which he pressed
on the French minister the danger of further trifling.[203]
Then came the climax of Imperial diplomacy. Neither Talleyrand
nor Champagny had shown repugnance to falsehood; whatever end
they wished, they used naturally and without hesitation the most
convenient means. Yet free as they were from scruples, one might
doubt whether Talleyrand or Champagny would have done what
Bassano did; for when the American minister impatiently demanded
some authentic evidence that the decrees were repealed, Bassano
complained that such a demand should be made when the American
government possessed the repealing decree itself. Barlow was struck
dumb with astonishment when the French minister then passed to
him a decree signed by Napoleon at St. Cloud, April 28, 1811,
declaring his previous decrees non-existent for American vessels
after Nov. 1, 1810.[204]
That the American minister should have lost self-possession in
the face of an act so surprising and so unexpected was natural, for
Talleyrand himself could hardly have controlled his features on
seeing this document, which for an entire year had been sought by
the whole world in vain, and which suddenly appeared as a paper so
well known as to need only an allusion. In his embarrassment
Barlow asked the vacant question whether this decree had been
published, as though his surprise could be no greater had the
document been printed in the “Moniteur” and the “National
Intelligencer,” or been sent to Congress with the President’s Annual
Message. Bassano replied that it had not been published, but had
been communicated at the time to Jonathan Russell and sent to
Serurier with orders to communicate it to the Secretary of State.
These assertions increased the American minister’s embarrassment,
for they implied a reflection on the American government which he
could not resent without in his turn implying that Napoleon had
invented the story so gravely told. Barlow said no more, but asked
for a copy of the repealing decree, which was sent to him May 10.
If evidence were necessary to show that no such decree was
issued April 28, 1811, Napoleon’s correspondence proves that the
Emperor did not consider the subject until April 29, and his note to
the Council dated that day is proof that no such decree had then
been adopted.[205] Yet such a decree might naturally have been
afterward ante-dated without objection. Had the Emperor signed it
within the year 1811 he might have set what date upon it he liked,
and need have made no mystery of the delay. The interest of
Bassano’s conduct lay not so much in his producing an ante-dated
paper as in his averring that the paper was not ante-dated, but had
been communicated to the American government at the time. The
flagrancy of the falsehood relieved it from the usual reproach of an
attempt to deceive; but if it did not embarrass Bassano in the telling,
it embarrassed President Madison beyond calculation in admitting.
Still more characteristic than the calmness with which Bassano
made these announcements to the American minister at Paris, was
the circumstantial gravity with which he repeated them to his own
minister at Washington. Writing the same day, May 10, 1812, he
enclosed a copy of the decree, explaining his reasons for doing so:
[206]—
“I have learned from Mr. Barlow that he is not acquainted with the
Decree of April 28, 1811, ... and I have addressed a copy to him. You
yourself, sir, have never acknowledged its reception; you have never
mentioned it in any of your despatches; you have never dwelt upon it
in any of your interviews with the American Secretary of State. This
silence makes me fear that the communication made of it to you
under date of May 2, 1811, did not reach you, and I think it proper to
enclose herewith a new copy.”
He explained at some length why he had ignored this decree in
his report to the conservative Senate:
“It had become useless to recall in this report a measure in respect
to which no one could longer raise a doubt; it would have been even
improper to specify the Americans by name; it would have entailed
other citations; it would have required too much prominence to be
given to the true motives of the Senatus Consultum which was to be
proposed. The Emperor had reason to complain of the numerous
infractions made by Russia in the Continental system, in spite of her
engagement to co-operate with and maintain it. Therefore against
Russia were directed the provisions of that report; but although
various circumstances rendered war inevitable, it was still necessary
to avoid naming her while preparing forces against her.”
Bold and often rash a diplomatist as Napoleon was, he still felt
that at the moment of going to war with Russia he could not entirely
disregard the wishes of the United States. In appearance he gave
way, and sacrificed the system so long and so tenaciously defended;
but in yielding, he chose means that involved the United States
government in common responsibility for his previous acts.
Even had the Emperor’s deception stopped there, it would have
offered the most interesting example in American experience of one
peculiarity of his genius; but this was not all. He seemed to grudge
the success which Barlow had wrung from him. One is tempted to
think that this victory cost Barlow his life. The decree he had gained
was flung at him like a missile. Bassano’s letter was dated May 10;
the Emperor already, the day before, had left Paris to take command
of his Grand Army on the Russian frontier, and as yet the negotiation
had not advanced a step. Meanwhile Barlow took a course of his
own. Monroe and Madison cared little for a commercial treaty, but
insisted upon indemnities. Barlow, finding that indemnity was for the
present out of the question, showed great earnestness to make a
commercial treaty, and admitted suggestions altogether displeasing
to his Government. Thus June arrived, producing no change in the
attitude of France other than the new decree, which was as grave an
offence to the President’s dignity as though it had been couched in
terms of the lie direct.
Deceived and deserted, Madison was driven without an ally into a
war that required the strongest alliances. Mortified at the figure he
had been made to present, he wrote to Barlow that the shameful
conduct of the French government would be an everlasting reproach
to it, and that if peace were made with England, “the full tide of
indignation with which the public mind here is boiling” would be
directed against France. His anger was the more bitter because of
his personal outrage. The repealing Decree of April, 1811, spared no
kind of humiliation, for it proved, even to himself, his error in
asserting that Napoleon imposed no condition precedent on the
original promise to withdraw his decrees.[207] On that point the
Federalists were shown to be right, and Madison could offer no
defence against their charge that he had made himself a tool of
Napoleon.
When Bassano left Paris to follow Napoleon into Russia he
intrusted the negotiation with Barlow to the Duc Dalberg, by birth a
German, who was in the Imperial service. While Dalberg listened to
Barlow and wrote long reports to Bassano, Napoleon, entering
Russia June 23, five days after Congress declared war against Great
Britain, advanced to Wilna in Poland, where he remained until July
17, and then with five hundred thousand men plunged into the heart
of Russia, leaving Bassano at Wilna with general charge of matters
of state. These events made Barlow conscious that his negotiation
was hopeless. His communications with Dalberg must be sent from
Paris to Wilna, and thence to Napoleon on the road to Moscow, with
the certainty of receiving no attention during the active campaign;
while even if Napoleon had been able to give them ample attention,
he would soon have taken offence at the increasing ill-temper of
their tone, and would have been more likely to show anger than to
grant favors. Under new instructions from Monroe, which were
almost a reprimand, Barlow said less and less about a commercial
treaty, and pressed harder for indemnities. Under instructions from
Bassano, dated August 10,[208] Dalberg was obliged to avoid the
discussion of indemnities and to talk only about commerce. Barlow
insisted upon explanations in regard to seventeen American vessels
recently burned at sea under the Decrees of Berlin and Milan; but no
explanation could be obtained from Bassano. When the news arrived
that Congress had declared war against England, Bassano, August
10, renewed his instructions to Dalberg without essential change:
[209]—
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.
textbookfull.com