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

PDF Computer Graphics For Java Programmers 3rd Edition Leen Ammeraal Download

Programmers

Uploaded by

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

PDF Computer Graphics For Java Programmers 3rd Edition Leen Ammeraal Download

Programmers

Uploaded by

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

Download the full version of the textbook now at textbookfull.

com

Computer Graphics for Java Programmers 3rd


Edition Leen Ammeraal

https://textbookfull.com/product/computer-
graphics-for-java-programmers-3rd-edition-leen-
ammeraal/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Computer Graphics Programming in OpenGL with Java Gordon

https://textbookfull.com/product/computer-graphics-programming-in-
opengl-with-java-gordon/

textbookfull.com

Computer Graphics Programming in OpenGL with Java 2nd


Edition V. Scott Gordon

https://textbookfull.com/product/computer-graphics-programming-in-
opengl-with-java-2nd-edition-v-scott-gordon/

textbookfull.com

Java 8 Pocket Guide Instant Help for Java Programmers 1st


Edition Liguori Robert Liguori Patricia

https://textbookfull.com/product/java-8-pocket-guide-instant-help-for-
java-programmers-1st-edition-liguori-robert-liguori-patricia/

textbookfull.com

Information Technology in Environmental Engineering


Proceedings of the 7th International Conference on
Information Technologies in Environmental Engineering ITEE
2015 1st Edition Jorge Marx Gómez
https://textbookfull.com/product/information-technology-in-
environmental-engineering-proceedings-of-the-7th-international-
conference-on-information-technologies-in-environmental-engineering-
itee-2015-1st-edition-jorge-marx-gomez/
textbookfull.com
Introduction to Software Engineering 2nd Edition Ronald J.
Leach

https://textbookfull.com/product/introduction-to-software-
engineering-2nd-edition-ronald-j-leach/

textbookfull.com

Politics of Translation in International Relations Zeynep


Gulsah Capan (Editor)

https://textbookfull.com/product/politics-of-translation-in-
international-relations-zeynep-gulsah-capan-editor/

textbookfull.com

Practical airport operations safety and emergency


management protocols for today and the future 1st Edition
Forrest
https://textbookfull.com/product/practical-airport-operations-safety-
and-emergency-management-protocols-for-today-and-the-future-1st-
edition-forrest/
textbookfull.com

Ritualized Writing Buddhist Practice and Scriptural


Cultures in Ancient Japan Bryan D Lowe

https://textbookfull.com/product/ritualized-writing-buddhist-practice-
and-scriptural-cultures-in-ancient-japan-bryan-d-lowe/

textbookfull.com

The Law of Journalism and Mass Communication 7th Edition


Susan D Ross Amy L Reynolds Robert E Trager

https://textbookfull.com/product/the-law-of-journalism-and-mass-
communication-7th-edition-susan-d-ross-amy-l-reynolds-robert-e-trager/

textbookfull.com
Bitten The Secret History of Lyme Disease and Biological
Warfare Kris Newby

https://textbookfull.com/product/bitten-the-secret-history-of-lyme-
disease-and-biological-warfare-kris-newby/

textbookfull.com
Leen Ammeraal · Kang Zhang

Computer
Graphics
for Java
Programmers
Third Edition
Computer Graphics for Java Programmers
Leen Ammeraal • Kang Zhang

Computer Graphics for Java


Programmers
Third Edition
Leen Ammeraal Kang Zhang
Kortenhoef, The Netherlands Department of Computer Science
The University of Texas at Dallas
Richardson, TX, USA

ISBN 978-3-319-63356-5 ISBN 978-3-319-63357-2 (eBook)


DOI 10.1007/978-3-319-63357-2

Library of Congress Control Number: 2017947160

© Springer International Publishing AG 2017


1st edition: © John Wiley & Sons Ltd 1998
2nd edition: © John Wiley & Sons Ltd 2007
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this
publication does not imply, even in the absence of a specific statement, that such names are exempt
from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this
book are believed to be true and accurate at the date of publication. Neither the publisher nor the
authors or the editors give a warranty, express or implied, with respect to the material contained
herein or for any errors or omissions that may have been made. The publisher remains neutral with
regard to jurisdictional claims in published maps and institutional affiliations.

Printed on acid-free paper

This Springer imprint is published by Springer Nature


The registered company is Springer International Publishing AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface

It has been 10 years since the publication of the second edition. The programming
language, Java, has now developed into its maturity, being the language of choice in
many industrial and business domains. Yet the skills of developing computer
graphics applications using Java are surprisingly lacked in the computer science
curricula. Though no longer active in classroom teaching, the first author has
developed and published several Android applications using Java, the main lan-
guage for Android developers. The second author has taught Computer Graphics at
his current university for the past 17 years using the first and second editions of
this textbook, apart from his previous years in Australia using different textbooks.
We feel strongly a need for updating the book.
This third edition continues the main theme of the first two editions, that is,
graphics programming in Java, with all the source code, except those for exercises,
available to the reader. Major updates in this new edition include the following:
1. The contents of all chapters are updated according to the authors’ years of
classroom experiences and recent feedback from our students.
2. Hidden-line elimination and hidden-face elimination are merged into a single
chapter.
3. A new chapter on color, texture, and lighting is added, as Chap. 7.
4. The companion software package, CGDemo, that demonstrates the working of
different algorithms and concepts introduced in the book, is enhanced with two
new algorithms added and a few bugs fixed.
5. A set of 37 video sessions (7–11 min each) in MOOC (Massive Open Online
Course) style, covering all the topics of the textbook, is supplemented.
6. A major exercise, split into four parts, on implementing the game of Tetris is
added at the end of four relevant chapters.
Many application examples illustrated in this book could be readily
implemented using Java 3D or OpenGL without any understanding of the internal
working of the implementation, which we consider undesirable for computer
science students. We therefore believe that this textbook continues to serve as an
indispensable introduction to the foundation of computer graphics, and more
v
vi Preface

importantly, how various classic algorithms are designed. It is essential for com-
puter science students to learn the skills on how to optimize time-critical algorithms
and how to develop elegant algorithmic solutions.
The example programs can be downloaded from the Internet at:
http://home.kpn.nl/ammeraal/
or at:
http://www.utdallas.edu/~kzhang/BookCG/
Finally, we would like to thank the UT-Dallas colleague Pushpa Kumar, who has
been using this textbook to teach undergraduate Computer Graphics class and
provided valuable feedback. We are grateful to Susan Lagerstrom-Fife of Springer
for her enthusiastic support and assistance in publishing this edition.

Kortenhoef, The Netherlands Leen Ammeraal


Richardson, TX, USA Kang Zhang
Contents

1 Elementary Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Pixels and Device Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Logical Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Anisotropic and Isotropic Mapping Modes . . . . . . . . . . . . . . . . . 12
1.4 Defining a Polygon Through Mouse Interaction . . . . . . . . . . . . . 19
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2 Applied Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.2 Inner Product and Vector Product . . . . . . . . . . . . . . . . . . . . . . . 31
2.3 The Orientation of Three Points . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4 Polygons and Their Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.5 Point-in-Polygon Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.6 Triangulation of Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.7 Point-on-Line Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.8 Projection of a Point on a Line . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.9 Distance Between a Point and a Line . . . . . . . . . . . . . . . . . . . . . 57
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3 Geometrical Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.1 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2 Linear Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.3 Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.4 Homogeneous Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.5 Inverse Transformations and Matrix Inversion . . . . . . . . . . . . . . 72
3.6 Rotation About an Arbitrary Point . . . . . . . . . . . . . . . . . . . . . . . 73
3.7 Changing the Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . 78
3.8 Rotations About 3D Coordinate Axes . . . . . . . . . . . . . . . . . . . . 79
3.9 Rotation About an Arbitrary Axis . . . . . . . . . . . . . . . . . . . . . . . 80
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

vii
viii Contents

4 Classic 2D Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.1 Bresenham Line Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.2 Doubling the Line-Drawing Speed . . . . . . . . . . . . . . . . . . . . . . . 97
4.3 Circle Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4.4 Cohen–Sutherland Line Clipping . . . . . . . . . . . . . . . . . . . . . . . . 106
4.5 Sutherland–Hodgman Polygon Clipping . . . . . . . . . . . . . . . . . . 112
4.6 Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.7 B-Spline Curve Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
5 Perspective and 3D Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.2 Viewing Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
5.3 Perspective Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.4 A Cube in Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
5.5 Specification and Representation of 3D Objects . . . . . . . . . . . . . 149
5.6 Some Useful Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.7 A Program for Wireframe Models . . . . . . . . . . . . . . . . . . . . . . . 172
5.8 Automatic Generation of Object Specification . . . . . . . . . . . . . . 177
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
6 Hidden-Line and Hidden-Face Removal . . . . . . . . . . . . . . . . . . . . . 191
6.1 Hidden-Line Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
6.2 Backface Culling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
6.3 Painter’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
6.4 Z-Buffer Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
7 Color, Texture, and Shading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
7.1 Color Theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
7.2 Additive and Subtractive Colors . . . . . . . . . . . . . . . . . . . . . . . . 227
7.3 RGB Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
7.4 HSV and HSL Color Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
7.5 Transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
7.6 Texture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
7.7 Surface Shading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
8 Fractals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
8.1 Koch Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
8.2 String Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
8.3 Mandelbrot Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
8.4 Julia Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Contents ix

Appendix A: Interpolation of 1/z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281


Appendix B: Class Obj3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Appendix C: Hidden-Line Tests and Implementation . . . . . . . . . . . . . . 293
Appendix D: Several 3D Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Appendix E: Hints and Solutions to Exercises . . . . . . . . . . . . . . . . . . . . 349
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Chapter 1
Elementary Concepts

This book is primarily about computer graphics programming and related mathe-
matics. Rather than discussing general graphics subjects for end users or how to use
graphics software, we will cover more fundamental subjects, required for graphics
programming. In this chapter, we will first understand and appreciate the nature of
discreteness of displayed graphics on computer screens. We will then see that x- and
y-coordinates need not necessarily be pixel numbers, also known as device coordi-
nates. In many applications, logical coordinates are more convenient, provided we
can convert them to device coordinates before displaying on the screen. With input
from a mouse, we would also need the inverse conversion, i.e. converting device
coordinates to logical coordinates, as we will see at the end of this chapter.

1.1 Pixels and Device Coordinates

The most convenient way of specifying a line segment on a computer screen is by


providing the coordinates of its two endpoints. In mathematics, coordinates are real
numbers, but primitive line-drawing routines may require these to be integers. This is
the case, for example, in the Java language, to be used throughout this book. The Java
Abstract Windows Toolkit (AWT) provides the class Graphics containing the method
drawLine, which we use as follows to draw the line segment connecting A and B:
g.drawLine(xA, yA, xB, yB);

The graphics context g in front of the method is normally supplied as a parameter


of the paint method in the program, and the four arguments of drawLine are
integers, ranging from zero to some maximum value. The above call to drawLine
produces exactly the same line on the screen as this one:

g.drawLine(xB, yB, xA, yA);

© Springer International Publishing AG 2017 1


L. Ammeraal, K. Zhang, Computer Graphics for Java Programmers,
DOI 10.1007/978-3-319-63357-2_1
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
2 1 Elementary Concepts

We will now use statements such as the above in a complete Java program.
Fortunately, you need not type these programs yourself, since they are available
from the Internet, as specified in the Preface. It will also be necessary to install the
Java Development Kit (JDK). If you are not yet familiar with Java, you should
consult other books, such as those mentioned in the Bibliography. This book
assumes you to be fluent in basic Java programming.
The following program draws the largest possible rectangle in a canvas. The
color red is used to distinguish this rectangle from the frame border:
// RedRect.java: The largest possible rectangle in red.
import java.awt.*;
import java.awt.event.*;

public class RedRect extends Frame {


public static void main(String[] args) {new RedRect();}

RedRect() {
super("RedRect");
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {Sytem.exit(0);}
});
setSize(300, 150);
add("Center", new CvRedRect());
setVisible(true);
}
}

class CvRedRect extends Canvas {


public void paint(Graphics g) {
Dimension d = getSize();
int maxX = d.width - 1, maxY = d.height - 1;
g.drawString("d.width = " + d.width, 10, 30);
g.drawString("d.height = " + d.height, 10, 60);
g.setColor(Color.red);
g.drawRect(0, 0, maxX, maxY);
}
}

The call to drawRect almost at the end of this program has the same effect as
these four lines:
g.drawLine(0, 0, maxX, 0); // Top edge
g.drawLine(maxX, 0, maxX, maxY); // Right edge
g.drawLine(maxX, maxY, 0, maxY); // Bottom edge
g.drawLine(0, maxY, 0, 0); // Left edge
1.1 Pixels and Device Coordinates 3

The program contains two classes:


RedRect: The class for the frame, also used to close the application.
CvRedRect: The class for the canvas, in which we display graphics output.
However, after compiling the program by entering the command

javac RedRect.java

we notice that three class files have been generated: RedRect.class, CvRedRect.
class and RedRect$1.class. The third one is referred to as an anonymous class since
it has no name in the program. It is produced by the following program segment:

addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});

which enables the user of the program to terminate it in the normal way. The
argument of the method addWindowListener must be an object of a class that
implements the interface WindowListener. This implies that this class must define
seven methods, one of which is windowClosing. The base class WindowAdapter
defines these seven methods as do-nothing functions. In the above program seg-
ment, the argument of addWindowListener denotes an object of an anonymous
subclass of WindowAdapter. In this subclass we override the method
windowClosing.
The RedRect constructor shows that the frame size is set to 400  200. If we do
not modify this size (by dragging a corner or an edge of the window), the canvas
size is somewhat smaller than the frame. After compilation, we run the program by
typing the command
java RedRect

which, with the given frame size, produces the largest possible red rectangle, shown
in Fig. 1.1 just inside the frame.
The blank area in a frame, which we use for graphics output, is referred to as a
canvas, which is a subclass, such as CvRedRect in program RedRect.java, of the
AWT class Canvas. If, instead, we displayed the output directly in the frame, we

Fig. 1.1 Largest possible


rectangle and canvas
dimensions
4 1 Elementary Concepts

would have a problem with the coordinate system: its origin would be in the top-left
corner of the frame; in other words, the x-coordinates increase from left to right and
y-coordinates from top to bottom. Although there is a method getInsets to obtain the
widths of all four borders of a frame so that we could compute the dimensions of the
client rectangle ourselves, we prefer to use a canvas.
The tiny screen elements that we can assign a color are called pixels (short for
picture elements), and the integer x- and y-values used for them are referred to as
device coordinates. Although there are 200 pixels on a horizontal line in the entire
frame, only 192 of these lie on the canvas, the remaining 8 being used for the left
and right borders. On a vertical line, there are 100 pixels for the whole frame, but
only 73 for the canvas. Apparently, the remaining 27 pixels are used for the title bar
and the top and bottom borders. Since these numbers may differ on different Java
implementations and the user can change the window size, it is desirable that our
program can determine the canvas dimensions. We do this by using the getSize
method of the class Component, which is a superclass of Canvas. The following
program lines in the paint method show how to obtain the canvas dimensions and
how to interpret them:
Dimension d = getSize();
int maxX = d.width - 1, maxY = d.height - 1;

The getSize method of Component (a superclass of Canvas) supplies us with the


numbers of pixels on horizontal and vertical lines of the canvas. Since we start
counting at zero, the highest pixel numbers, maxX and maxY, on these lines are one
less than these numbers of pixels. Remember that this is similar with arrays in Java
and C. For example, if we write:

int[] a = new int[8];

the highest possible index value is 7, not 8. In such cases, the “index” is always one
less than “size”. Figure 1.2 illustrates this for a very small canvas, which is only
8 pixels wide and 4 high, showing a much enlarged screen grid structure. It also
shows that the line connecting the points (0, 0) and (7, 3) is approximated by a set of
eight pixels.

Fig. 1.2 Pixels as


coordinates in a 8  4
canvas (with maxX ¼ 7
and maxY ¼ 3)
1.1 Pixels and Device Coordinates 5

The big dots approximating the line denote pixels that are set to the foreground
color. By default, this foreground color is black, while the background color is
white. These eight pixels are made black as a result of this call:

g.drawLine(0, 0, 7, 3);

In the program RedRect.java, we used the following call to the drawRect method
(instead of four calls to drawLine):
g.drawRect(0, 0, maxX, maxY);

In general, the call:

g.drawRect(x, y, w, h);

draws a rectangle with (x, y) as its top-left and (x + w, y + h) as its bottom-right


corners. In other words, the third and fourth arguments of the drawRect method
specify the width and height, rather than the bottom-right corner, of the rectangle to
be drawn. Note that this rectangle is w + 1 pixels wide and h + 1 pixels high. The
smallest possible square, consisting of 2  2 pixels, is drawn by this call:

g.drawRect(x, y, 1, 1);

To put only one pixel on the screen, we cannot use drawRect, because nothing at
all appears if we try to set the third and fourth arguments of this method to zero.
Curiously enough, Java does not provide a special method for this purpose, so we
have to use this method:
g.drawLine(x, y, x, y);

Note that the method:

g.drawLine(xA, y, xB, y);

draws a horizontal line consisting of jxB – xAj + 1 pixels.


In mathematics, lines are continuous without thickness, but are discrete and at
least one pixel thick in computer graphics output. This difference in the interpre-
tation of the notion of lines may not cause any problems if the pixels are very small
in comparison with what we are drawing. However, we should be aware that there
may be such problems in special cases, as Fig. 1.3a illustrates. Suppose that we have
to draw a filled square ABCD of, say, 4  4 pixels, consisting of the bottom-right
triangle ABC and the upper-left triangle ACD, which we want to paint in dark gray
and light gray, respectively, without drawing any lines. Strangely enough, it is not
clear how this can be done: if we make the diagonal AC light gray, triangle ABC
contains fewer pixels than triangle ACD; if we make AC dark gray, it is the other
way round.
6 1 Elementary Concepts

Fig. 1.3 Small filled


regions

A much easier but still non-trivial problem, illustrated in Fig. 1.3b, is filling a
checker-board with, say, dark and light gray squares instead of black and white
ones. Unlike squares in mathematics, those on the computer screen deserve special
attention with regard to the edges belonging or not belonging to the filled regions.
We have seen that the call:
g.drawRect(x, y, w, h);

draws a rectangle with corners (x, y) and (x + w, y + h). The method fillRect, on the
other hand, fills a slightly smaller rectangle. The call:
g.fillRect(x, y, w, h);

assigns the current foreground color to a rectangle consisting of w  h pixels. This


rectangle has (x, y) as its top-left and (x + w  1, y + h  1) as its bottom-right
corner. To obtain a generalization of Fig. 1.3b, the following method, checker,
draws an n  n checker board, with (x, y) as its top-left corner and with dark gray
and light gray squares, each consisting of w  w pixels. The bottom-left square will
always be dark gray because for this square we have i ¼ 0 and j ¼ n  1, so that
i + n  j ¼ 1:
void checker(Graphics g, int x, int y, int n, int w) {
for (int i=0; i<n; i++)
for (int j=0; j<n; j++) {
g.setColor((i + n - j) % 2 == 0 ?
Color.lightGray : Color.darkGray);
g.fillRect(x + i * w, y + j * w, w, w);
}
}

If we wanted to draw only the edges of each square, also in dark gray and light
gray, we would have to replace the above call to fillRect with
g.drawRect(x + i * w, y + j * w, w - 1, w - 1);

in which the last two arguments are w – 1 instead of w.


1.2 Logical Coordinates 7

1.2 Logical Coordinates

The Direction of the y-axis

As Fig. 1.2 shows, the origin of the device-coordinate systems lies at the top-left
corner of the canvas, so that the positive y-axis points downward. This is reasonable
for text output, that starts at the top and increases y as we go to the next line of text.
However, this direction of the y-axis is different from typical mathematical practice
and therefore often inconvenient in graphics applications. For example, in a dis-
cussion about a line with a positive slope, we expect to go upward when moving
along this line from left to right. Fortunately, we can arrange for the positive
y direction to be reversed by performing this simple transformation:

y 0 ¼ maxY  y

Continuous Versus Discrete Coordinates

Instead of the discrete (integer) coordinates at the lower, device oriented level, we
often wish to use continuous (floating-point) coordinates at the higher, problem-
oriented level. Other usual terms are device and logical coordinates, respectively.
Writing conversion routines to compute device coordinates from the corresponding
logical ones and vice versa is a bit tricky. We must be aware that there are two
solutions to this problem: rounding and truncating, even in the simple case in which
increasing a logical coordinate by one results in increasing the device coordinate
also by one. We wish to write the following methods:
iX(x), iY( y): converting the logical coordinates x and y to device coordinates;
fx(x), fy( y): converting the device coordinates X and Y to logical coordinates.
One may notice that we have used lower-case letters to represent logical coordi-
nates and capital letters to represent device coordinates. This will be the convention
used throughout this book. With regard to x-coordinates, the rounding solution
could be:

int iX(float x){return Math.round(x);}


float fx(int x){return (float)x;}

For example, with this solution we have


iXð2:8Þ ¼ 3 and fxð3Þ ¼ 3:0

The truncating solution could be:

int iX(float x){return (int)x;} // Not used in


float fx(int x){return (float)x + 0.5F;} // this book.
8 1 Elementary Concepts

With these conversion functions, we would have

iXð2:8Þ ¼ 2 and fxð3Þ ¼ 2:5


We will use the rounding solution throughout this book, since it is the better choice
if logical coordinates frequently happen to be integer values. In these cases the
practice of truncating floating-point numbers will often lead to worse results than
those with rounding.
Apart from the above methods iX and fx (based on rounding) for x-coordinates,
we need similar methods for y-coordinates, taking into account the opposite direc-
tions of the two y-axes. At the bottom of the canvas the device y-coordinate is maxY
while the logical y-coordinate is 0, which may explain the two expressions of the
form maxY – . . . in the following methods:

int iX(float x){return Math.round(x);}


int iY(float y){return maxY - Math.round(y);}
float fx(int x){return (float)x;}
float fy(int y){return (float)(maxY - y);}

Figure 1.4 shows a fragment of a canvas, based on maxY ¼ 16.


The pixels are drawn as black dots, each placed in the center of a square of
dashed lines and the device-coordinates (X, Y ) are placed between parentheses near
each dot. For example, the pixel with device coordinates (8, 2), at the upper-right
corner of this canvas fragment, has logical coordinates (8.0, 14.0). We have:

iX(8.0) = Math.round(8.0) = 8
iY(14.0) = 16 - Math.round(14.0) = 2
fx(8) = (float)8 = 8.0
fy(2) = (float)(16 - 2) = 14.0

Fig. 1.4 Logical and device coordinates, based on ymax ¼ 16


1.2 Logical Coordinates 9

The dashed square around this dot denotes all points (x, y) satisfying
7:5  x < 8:5
13:5  y < 14:5
All these points are converted to the pixel (8, 2) by our methods iX and iY.
Let us demonstrate this way of converting floating-point logical coordinates to
integer device coordinates in a program that begins by drawing an equilateral
triangle ABC, with the side AB at the bottom and point C at the top. Then, using
q ¼ 0:05
p ¼ 1  q ¼ 0:95,
we compute the new points A0 , B0 and C0 near A, B and C and lying on the sides AB,
BC and CA, respectively, writing:
xA1 = p * xA + q * xB;
yA1 = p * yA + q * yB;
xB1 = p * xB + q * xC;
yB1 = p * yB + q * yC;
xC1 = p * xC + q * xA;
yC1 = p * yC + q * yA;

We then draw the triangle A0 B0 C0 , which is slightly smaller than ABC and turned
a little counter-clockwise. Applying the same principle to triangle A0 B0 C0 to obtain
a third triangle, A00 B00 C00 , and so on, until 50 triangles have been drawn, the result
will be as shown in Fig. 1.5.

Fig. 1.5 Triangles, drawn inside each other


10 1 Elementary Concepts

If we change the dimensions of the window, new equilateral triangles appear,


again in the center of the canvas and with dimensions proportional to the size of this
canvas. Without floating-point logical coordinates and with a y-axis pointing
downward, this program would have been less easy to write:

// Triangles.java: This program draws 50 triangles inside


// each other.
import java.awt.*;
import java.awt.event.*;

public class Triangles extends Frame {


public static void main(String[] args) {new Triangles();}

Triangles() {
super("Triangles: 50 triangles inside each other");
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});
setSize(600, 400);
add("Center", new CvTriangles());
setVisible(true);
}
}

class CvTriangles extends Canvas {


int maxX, maxY, minMaxXY, xCenter, yCenter;

void initgr() {
Dimension d = getSize();
maxX = d.width - 1; maxY = d.height - 1;
minMaxXY = Math.min(maxX, maxY);
xCenter = maxX / 2; yCenter = maxY / 2;
}

int iX(float x) {return Math.round(x);}

int iY(float y) {return maxY - Math.round(y);}

public void paint(Graphics g) {


initgr();
float side = 0.95F * minMaxXY, sideHalf = 0.5F * side,
h = sideHalf * (float) Math.sqrt(3),
xA, yA, xB, yB, xC, yC, xA1, yA1, xB1, yB1, xC1, yC1, p, q;
q = 0.05F; p = 1 - q;
xA = xCenter - sideHalf; yA = yCenter - 0.5F * h;
1.2 Logical Coordinates 11

xB = xCenter + sideHalf; yB = yA;


xC = xCenter; yC = yCenter + 0.5F * h;
for (int i = 0; i < 50; i++) {
g.drawLine(iX(xA), iY(yA), iX(xB), iY(yB));
g.drawLine(iX(xB), iY(yB), iX(xC), iY(yC));
g.drawLine(iX(xC), iY(yC), iX(xA), iY(yA));
xA1 = p * xA + q * xB; yA1 = p * yA + q * yB;
xB1 = p * xB + q * xC; yB1 = p * yB + q * yC;
xC1 = p * xC + q * xA; yC1 = p * yC + q * yA;
xA = xA1; xB = xB1; xC = xC1;
yA = yA1; yB = yB1; yC = yC1;
}
}
}

In the canvas class CvTriangles there is a method initgr. Together with the other
program lines that precede the paint method in this class, initgr may also be useful
in other programs.
It is important to notice that, on each triangle edge, the computed floating-point
coordinates, not the integer device coordinates derived from them, are used for
further computations. This principle, which applies to many graphics applications,
can be depicted as follows:

which is in contrast to the following scheme, which we should avoid. Here int
device coordinates containing rounding-off errors are used not only for graphics
output but also for further computations, so that such errors will accumulate:

In summary, we compare and contrast the logical and device coordinate systems in
the following table, in terms of (1) the convention used in the text, but not in Java
programs, of this book, (2) the data types of the programming language, (3) the
coordinate value domain, and (4) the direction of positive y-axis:

Coordinate system Convention Data type Value domain Positive y-axis


Logical Lower-case letters float Continuous Upward
Device Upper-case letters integer Discrete Downward
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
12 1 Elementary Concepts

1.3 Anisotropic and Isotropic Mapping Modes

Mapping a Continuous Interval to a Sequence of Integers

Suppose we want to map an interval of real logical coordinates, such as


0  x  10:0

to the set of integer device coordinates {0, 1, 2, . . ., 9}. Unfortunately, the method:

int iX(float x){return Math.round(x);}

used in the previous section, is not suitable for this purpose because for any
x greater than 9.5 (and not greater than 10) it returns 10, which does not belong
to the allowed sequence 0, 1, ..., 9. In particular, it gives:
ix(10.0) = 10

while we want:

ix(10.0) = 9

This suggests that in an improved method iX we should use a multiplication


factor of 0.9. We can also come to this conclusion by realizing that there are only
nine small intervals between ten pixels labeled 0, 1, . . .9, as Fig. 1.6 illustrates. If
we define the pixel width (¼ pixelWidth) as the distance between two successive
pixels on a horizontal line, the above interval 0  x  10 of logical coordinates
(being real numbers) corresponds to 9  pixelWidth. So in this example we have:
9  pixelWidth ¼ 10:0 ðthe length of the interval of logical coordinatesÞ
pixelWidth ¼ 10=9 ¼ 1:111 . . .

In general, if a horizontal line of our canvas consists of n pixels, numbered 0, 1,


. . ., maxX (where maxX ¼ n  1), and the corresponding (continuous) interval of
logical coordinates is 0  x  rWidth, we can use the following method:

int iX(float x){return Math.round(x/pixelWidth);}

where pixelWidth is computed beforehand as follows:

maxX = n - 1;
pixelWidth = rWidth/maxX;
1.3 Anisotropic and Isotropic Mapping Modes 13

9 ´ pixel Width

Pixel number X 0 1 2 3 4 5 6 7 8 9

Logical x 0 1 2 3 4 5 6 7 8 9 10

10 logical units

Fig. 1.6 Pixels lying 10/9 logical units apart

In the above example the integer n is equal to the interval length rWidth, but it is
often desirable to use logical coordinates x and y satisfying
0  x  rWidth
0  y  rHeight

where rWidth and rHeight are real numbers, such as 10.0 and 7.5, respectively,
which are quite different from the numbers of pixels that lie on horizontal and
vertical lines. It will then be important to distinguish between isotropic and
anisotropic mapping modes, as we will discuss in a moment.
As for the simpler method:

int iX(float x){return Math.round(x);}

of the previous section, this can be regarded as a special case of the improved one
we have just seen, provided we use pixelWidth ¼ 1, that is rWidth ¼ maxX, or
rWidth ¼ n  1. For example, if the drawing rectangle is 100 pixels wide, so that
n ¼ 100 and we can use the pixels 0, 1, 2, . . ., 99 ¼ maxX on a horizontal line, this
simpler method iX works correctly if it is applied to logical x-coordinates satisfying
0  x  rWidth ¼ 99:0

The point to be noticed is that, due to the value pixelWidth ¼ 1, the logical width is
99.0 here although the number of available pixels is 100.

Anisotropic Mapping Mode

The term anisotropic mapping mode implies that the scale factors for x and y are not
necessarily equal, as the following code segment shows:
14 1 Elementary Concepts

Dimension d = getSize();
maxX = d.width - 1; maxY = d.height - 1;
pixelWidth = rWidth/maxX;
pixelHeight = rHeight/maxY;
...
int iX(float x){return Math.round(x/pixelWidth);}
int iY(float y){return maxY - Math.round(y/pixelHeight);}
float fx(int x){return x * pixelWidth;}
float fy(int y){return (maxY - y) * pixelHeight;}

We will use this in a demonstration program. Regardless of the window dimen-


sions, the largest possible rectangle in this window has the logical dimensions
10.0  7.5. After clicking on a point of the canvas, the logical coordinates are
shown as in Fig. 1.7.
Since there are no gaps between this largest possible rectangle and the window
edges, we can only see this rectangle in Fig. 1.7 with some difficulty. In contrast,
the screen will show this rectangle very clearly because we will make it red instead
of black. Although the window dimensions in Fig. 1.7 have been altered by the
user, the logical canvas dimensions are still 10.0  7.5. The text displayed in the
window shows the coordinates of the point near the upper-right corner of the
rectangle, as the cross-hair cursor indicates. If the user clicks exactly on that
corner, the coordinate values 10.0 and 7.5 are displayed. This demonstration
program is listed below.

Fig. 1.7 Logical coordinates with anisotropic mapping mode


1.3 Anisotropic and Isotropic Mapping Modes 15

// Anisotr.java: The anisotropic mapping mode.


import java.awt.*;
import java.awt.event.*;

public class Anisotr extends Frame {


public static void main(String[] args) {new Anisotr();}

Anisotr() {
super("Anisotropic mapping mode");
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});
setSize(400, 300);
add("Center", new CvAnisotr());
setCursor(Cursor.getPredefinedCursor(
Cursor.CROSSHAIR_CURSOR));
setVisible(true);
}
}

class CvAnisotr extends Canvas {


int maxX, maxY;
float pixelWidth, pixelHeight, rWidth = 10.0F, rHeight = 7.5F,
xP = -1, yP;

CvAnisotr() {
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent evt) {
xP = fx(evt.getX()); yP = fy(evt.getY());
repaint();
}
});
}

void initgr() {
Dimension d = getSize();
maxX = d.width - 1; maxY = d.height - 1;
pixelWidth = rWidth / maxX; pixelHeight = rHeight / maxY;
}

int iX(float x) {return Math.round(x / pixelWidth);}


int iY(float y) {return maxY - Math.round(y / pixelHeight);}
float fx(int x) {return x * pixelWidth;}
float fy(int y) {return (maxY - y) * pixelHeight;}
16 1 Elementary Concepts

public void paint(Graphics g) {


initgr();
int left = iX(0), right = iX(rWidth),
bottom = iY(0), top = iY(rHeight);
if (xP >= 0)
g.drawString(
"Logical coordinates of selected point: " +
xP + " " + yP, 20, 100);
g.setColor(Color.red);
g.drawLine(left, bottom, right, bottom);
g.drawLine(right, bottom, right, top);
g.drawLine(right, top, left, top);
g.drawLine(left, top, left, bottom);
}
}

With the anisotropic mapping mode, the actual length of a vertical unit can be
different from that of a horizontal unit. This is the case in Fig. 1.7: although the
rectangle is 10 units wide and 7.5 units high, its real height is less than 0.75 of its
width. In particular, the anisotropic mapping mode is not suitable for drawing
squares, circles and other shapes that require equal units in the horizontal and
vertical directions.

Isotropic Mapping Mode

We can arrange for horizontal and vertical units to be equal in terms of their real
size by using the same scale factor for x and y. Let us use the term drawing
rectangle for the rectangle with dimensions rWidth and rHeight, in which we
normally draw graphical output. Since these logical dimensions are constant, so is
their ratio, which is not the case with that of the canvas dimensions. It follows that,
with the isotropic mapping mode, the drawing rectangle will in general not be
identical with the canvas. Depending on the current window size, either the top and
bottom or the left and right edges of the drawing rectangle lie on those of the
canvas.
Since it is normally desirable for a drawing to appear in the center of the canvas,
it is often convenient with the isotropic mapping mode to place the origin of the
logical coordinate system in that center. This implies that we will use the following
logical-coordinate intervals:

½rWidth  x  þ½rWidth
½rHeight  y  þ½rHeight
Random documents with unrelated
content Scribd suggests to you:
often the stimulus starts only a reflex action, usually at the place of
application.
A stimulus acting for but a short time produces no lasting effect
on the idioplasm. A person stung by a wasp suffers no permanent
effect from the injury. But if a stimulus acts for a long time, and
through a large number of generations, then it may, even if of small
strength, so change the idioplasm, that a tendency or disposition
capable of being seen may be the result. This appears to be the case
in regard to the action of light, which causes certain parts of the
plant to turn toward it and others away from it; also for the action of
gravity, which determines the downward direction of the roots. It
may be claimed, perhaps, that these are the results of direct
influence and not of an internal response, but this is not the case;
for some plants act in exactly the opposite way, and send a stem
downward, as in the case of the cleistogamous flowers of Cardamine
chenopodifolia; and other plants turn away from the light. This
means that the idioplasm behaves differently in different plants in
response to the same stimulus.
Concerning the more visible effects of adaptation, Nägeli states
that in regard to some of them there can be no question as to how
they must have arisen. Protection against cold, by the formation of a
thick coat of hair, is the direct result of the action of the cold on the
skin of the animal. The different weapons of offence and of defence,
horns, spurs, tusks, etc., have arisen, he maintains, through stimulus
to those parts of the body where these structures arise.
The causes of the other adaptations, especially of those occurring
in plants, are less obvious. Land plants protect themselves from
drying by forming a layer of cork over the surface. The most
primitive plants were water plants, which acclimated themselves
little by little to moist, and then to dry, air. When they first emerged
from the water the drying acted as a stimulus on the surface, and
caused it to harden in the same way as a drop of glue hardens. This
hardening in turn acted as a stimulus, causing a chemical
transformation of the surface into a corky substance. This effect was
inherited, and in this way the power to form cork originated.
Land plants have, in addition to the soft parts, the hard bast and
wood which serves the mechanical purpose of supporting the soft
tissues and protecting them from being injured. The arrangement of
the hard parts is such as to suggest that they are the result of the
action of pressures and tensions on the plant, for the strongest cells
are found where there is most need for them. It is easy to imagine,
Nägeli adds, that this important arrangement of the tissues is the
result of external forces which brought about the result in these
parts.
Nägeli accounts for the origin of twining plants as follows. Being
overshadowed by other plants, the stem will grow rapidly in the
damp air. Coming in contact with the stems of other plants, the
delicate stem is stimulated on one side, and grows around the point
of contact. This tendency becomes inherited, and the habit to twine
is ultimately established.
The difference in the two sides of leaves is explained by Nägeli as
the result of the difference in the illumination of the two sides. This
influence of light on the leaf has been inherited. The formation of
the tubular corolla that is seen in many plants visited by insects is
explained as the result of the stimulus produced by the insects in
looking for the pollen. The increase in the length of the proboscis of
the insect is the result of the animal straining to reach the bottom of
the ever elongating tube of the corolla. “The tubular corolla and the
proboscis of the insect appear as though made for each other. Both
have slowly developed to their present condition, the long tube from
a short tube and the long proboscis from a short one.” Thus, by
purely Lamarckian principles, Nägeli attempts to account for many of
the adaptations between the organism and the outer world. But if
this takes place, where is there left any room for the action for his
so-called perfecting principle? Nägeli proceeds to show how he
supposes that the two work together.
As a result of inner causes the organism would pass through a
series of perfectly definite stages, J, J1, J2. But if, at any stage,
external influences produced an effect on the organism so that the
arrangement of the idioplasm changes in response, a new
adaptation is produced. In this way new characters, not inherent in
the idioplasm, may be added, and old ones be changed or lost. “In
order not to be misunderstood in regard to the completing or
perfecting principle I will add, that I ascribe to it no determinate
action in the organism, neither in producing the long neck of the
giraffe, nor the prehensile tail of the ape, neither the claws of the
crab, nor the decoration of the bird of paradise. These structures are
the outcome of both factors. I cannot picture to myself how external
causes alone, and just as little how internal causes alone, could have
changed a monad into a man.” But Nägeli goes on to say, that if at
any stage of organization one of the two causes should cease to act,
the other could only produce certain limited results. Thus, if external
causes alone acted, the organization would remain at the same
stage of completeness, but might become adapted to all kinds of
external conditions—a worm, for instance, would not develop into a
fish, but would remain a worm forever, although it might change its
worm structure in many ways in response to external stimuli. If, on
the other hand, only the completing principle acted, then without
changing its adaptations the number of the cells and the size of the
organs might be increased, and functions that were formerly united
might become separated. Thus, without altering the character of the
organism, a more highly developed (in the sense of being more
specialized) organism would appear.
Nägeli, as we have just seen, has attempted to build up a
conception of nature based on two assumptions, neither of which
has been demonstrated to be an actual principle of development. His
hypothesis appears, therefore, entirely arbitrary and speculative to a
high degree. Even if it were conceivable that two such principles as
these control the evolution of organisms, it still requires a good deal
of imagination to conceive how the two go on working together.
Moreover, it is highly probable that whole groups have evolved in the
direction of greater simplification, as seen especially in the case of
those groups that have become degenerate. To what principle can
we refer processes of this sort?
It is certainly a strange conclusion this, at which Nägeli finally
arrives, for, after strenuously combating the idea that the external
factors of climate and of food have influence in producing new
species, he does not hesitate to ascribe all sorts of imaginary
influences to other external causes. The apparent contradiction is
due, perhaps, to the fact that his experience with actual species led
him to deny that the direct action of the environment produces
permanent changes, while in theory he saw the necessity of adding
to his perfecting principle some other factor to explain the
adaptations of the new forms produced by inner causes. Nägeli
seems to have felt strongly the impossibility of explaining the
process of evolution and of adaptation as the outcome of the
selection of chance variations, now in this direction, now in that. He
seems to have felt that there must be something within the
organism that is driving it ever upward, and he attempts to avoid the
teleological element, which such a conception is almost certain to
introduce, by postulating the inheritance of the effects of long-
continued action of the environment, in so far as certain factors in
the environment produce a response in the organism. Nevertheless,
this combination is not one that is likely to commend itself, aside
from the fact that the assumptions have no evidence to support
them. Despite Nägeli’s protest that his principles are purely physical,
and that there is nothing mystical in his point of view, it must be
admitted that his conception, as a whole, is so vague and difficult in
its application that it probably deserves the neglect which it
generally receives.
Nägeli’s wide experience with living plants convinced him that
there is something in the organism over and beyond the influence of
the external world that causes organisms to change; and we cannot
afford, I think, to despise his judgment on this point, although we
need not follow him to the length of supposing that this internal
influence is a “force” driving the organism forward in the direction of
ever greater complexity. A more moderate estimate would be that
the organism often changes through influences that appear to us to
be internal, and while some of the changes are merely fluctuating or
chance variations, there are others that appear to be more limited in
number, but perfectly definite and permanent in character. It is the
latter, which, I believe, we can safely accredit to internal factors, and
which may be compared to Nägeli’s internal causes, but this is far
from assuming that these changes are in the direction of greater
completeness or perfection, or that evolution would take place
independently of the action of external agencies.
CHAPTER X

THE ORIGIN OF THE DIFFERENT KINDS OF ADAPTATIONS

In the present chapter we may first consider, from the point of


view of discontinuous variations as contrasted with the theory of the
selection of individual variations, the structural adaptations of
animals and plants, i.e. those cases in which the organism has a
definite form that adapts it to live in a particular environment. In the
second place, we may consider those adaptations that are the result
of the adjustment of each individual to its surroundings. In
subsequent chapters the adaptations connected with the responses
of the nervous system and with the process of sexual reproduction
will be considered.
It should be stated here, at the outset, that the term mutation will
be used in the following chapters in a very general way, and it is not
intended that the word shall convey only the idea which De Vries
attaches to it; it is used rather as synonymous with discontinuous
and also definite variation of all kinds. The term will be used to
include “the single variations” of Darwin, “sports,” and even
orthogenic variation, if this has been definite or discontinuous.
Form and Symmetry
Almost without exception, animals and plants have definite and
characteristic forms. In other words, they are not amorphous masses
of substance. The members of each species conform, more or less,
to a sort of ideal type. Our first problem is to examine in what sense
the form itself may be looked upon as an adaptation to the
surroundings.
It is a well-recognized fact that the forms of many animals appear
to stand in a definite relation to the environment. For instance,
animals that move in definite directions in relation to their structure
have the anterior and the posterior ends quite different, and it is
evident that these ends stand in quite different relations to
surrounding objects; while, on the other hand, the two sides of the
body which are, as a rule, subjected to the same influences are
nearly exactly alike. The dorsal and the ventral surfaces of the body
are generally exposed to very different external conditions, and are
quite different in structure.
The relation is so obvious in most cases that it might lead one
quite readily to conclude that the form of the animal had been
moulded by its surroundings. Yet this first impression probably gives
an entirely wrong conception of how such a relation has been
acquired. Before we attempt to discuss this question, let us examine
some typical examples.
A radial type of structure is often found in fixed forms, and in
some floating forms, like the jellyfish. In a fixed form, a sea-
anemone, for instance, the conditions around the free end and the
fixed end of the body are entirely different, and we find that these
two ends are also different. The free end contains the special sense-
organs, the mouth, tentacles, etc.; while the fixed end contains the
organ for attachment. It is evident that the free end is exposed to
the same conditions in all directions, and it may seem probable that
this will account for the radial symmetry of the anemone. There are
also a few free forms, the sea-urchin for instance, that have a radial
symmetry. Whether their ancestors were fixed forms, for which there
is some evidence, we do not know definitely; but, even if this is true,
it does not affect the main point, namely, that, although at present
free to move, the sea-urchin is radially symmetrical. But when we
examine its method of locomotion, we find that it moves indifferently
in any direction over a solid surface; that is, it keeps its oral face
against a solid object, and moves over the surface in any direction.
Under these circumstances the same external conditions will act
equally upon all sides of the body. In contrast to these common sea-
urchins, there are two other related groups, in which, although
traces of a well-marked radial symmetry are found, the external form
has been so changed that a secondary bilateral form has been
superimposed on it. These are the groups of the clypeasters and the
spatangoids, and it is generally supposed that their forefathers were
radially symmetrical forms like the ordinary forms of sea-urchins.
These bilateral forms move in the direction of their plane of
symmetry, but we have no means of knowing whether they first
became bilateral and, in consequence, now move in the direction of
the median plane, or whether they acquired the habit of moving in
one direction, and in consequence acquired a bilateral symmetry. It
seems more probable that the form changed first, for otherwise it is
difficult to see why a change of movement in one direction should
ever have taken place.
The radially symmetrical form is characteristic of many flowers
that stand on the ends of their stalks. They also will be subjected to
similar external influences in all directions. Many flowers, on the
other hand, are bilaterally symmetrical. Some of these forms are of
such a sort that they are generally interpreted as having been
acquired in connection with the visits of insects. Be this as it may, it
is still not clear why, if the flowers are terminal, insects should not
approach them equally from every direction. If the flowers are not
terminal, as, in fact, many of them are not, their relation to the
surroundings is bilateral with respect to internal as well as to
external conditions. The former, rather than the latter, may have
produced the bilateral form of the flower. Here also we meet with
the problem as to whether the flowers, being lateral in position,
have assumed a bilateral form because their internal relations were
bilateral; or whether an external relation, for example, the visits of
insects, has been the principle cause of their becoming bilateral.

Fig. 4.—A, right and left claws of lobster;


B, of the fiddler-crab; and
C, of Alpheus.
In some bilateral forms the right and left sides may be
unsymmetrical in certain organs. Right and left handedness in man
is the most familiar example, although the structural difference on
which this rests is not very obvious. More striking is the difference in
the two big claws of the lobster (Fig. 4 A). One of the two claws is
flat and has a fine saw-toothed edge. The other is thicker and has
rounded knobs instead of teeth. It is said that these two claws are
used by the lobster for different purposes,—the heavy one for
crushing and for holding on, and the narrower for cutting up the
food. If this is true, then we find a symmetrical organism becoming
unsymmetrical, and in consequence it takes advantage of its
asymmetry by using its right and left claws for different purposes.
More striking still is the difference in the size of the right and left
claws in a related form, Alpheus—a crayfish-like form that lives in
the sea. With the larger claw (Fig. 4 C) it makes a clicking sound
that can be heard for a long distance. In some of the crabs the
difference in the size of the two claws is enormous, as in the male
fiddler-crab, for example (Fig. 4 B). One of the claws is so big and
unwieldy that it must put the animal at a distinct disadvantage. Its
use is unknown, although it has been suggested that it is a
secondary sexual character.
The asymmetry of the body of the snail is very conspicuous, at
least so far as certain organs are concerned. The foot on which the
animal crawls and the head have preserved their bilaterality; but the
visceral mass of the animal, contained in the spirally wound shell,
lying on the middle of the upper surface of the foot, is twisted into a
spiral form. Many of the organs of one side of the body are
atrophied. The gill, the kidney, the reproductive organ, and one of
the auricles of the heart have completely, or almost completely,
disappeared. The cause of this loss seems to be connected with the
spiral twist of the visceral mass. One of the consequences of the
twisting has been to bring the organs of the left side of the body
around the posterior end until they come to lie on the right side, the
organs of the original right side being carried forward and there
atrophying.
There is another remarkable fact connected with the asymmetry
of the snail. In some species, Helix pomatia, for example, the twist
has been toward the right, i.e. in the direction which the hands of a
watch follow when the face is turned upward toward the observer.
Individuals twisted in this direction are called dextral. Occasionally
there is found an individual with the spiral in the opposite direction
(sinistral), and in this the conditions of the internal organs are
exactly reversed. It is the left set of organs that is now atrophied,
and the right set that is functional. Such changes appear suddenly.
Organs of one side of the body that have not been functional for
many generations may become fully developed. Moreover, Lang has
shown that when a sinistral form breeds with a normal dextral form,
or even when sinistral forms are bred with each other, the young are
practically all of the ordinary type.
An attempt has been made to connect these facts with the mode
of development of the mollusks. It is known that the eggs of a
number of gasteropod mollusks segment in a perfectly definite
manner. A sort of spiral cleavage is followed by the formation of a
large mesodermal cell from the left posterior yolk-cell. From this
mesodermal cell nearly all the mesodermal organs of the body are
formed. Thus it may appear that the spiral form of the snail is
connected with the spiral form of the cleavage. In a few species of
marine and fresh-water snails the cleavage spiral is reversed, and
the mesoderm arises from the right posterior yolk-cell. It has been
shown in several cases that the snail coming from such an egg is
twisted in the reverse direction from that of ordinary snails.
It has been suggested, therefore, that the occasional sinistral
individual of Helix arises from an egg cleaving in the reverse
direction, and there is nothing improbable in an assumption of this
kind. No attempt has been made as yet to explain why, in some
cases, the cleavage spiral is turned in one direction, and in other
cases in the reverse direction; but even leaving this unaccounted for,
the assumption of the unusual form of Helix being the result of a
reversal of the cleavage throws some light as to how it is possible for
the complete reversal of the organs of the adult to arise. If it is
assumed that in the early embryo the cells on each side of the
median line are alike, and at this time capable of forming adult
structures, a simple change of the spiral from right to left might
determine on which side of the middle line the mesodermal cell
would lie, and its presence on one side rather than on the other
might determine which side of the embryo would develop, and which
would not. This possibility removes much of the mystery which may
appear to surround a sudden change of this sort.
It seems to me that we shall not go far wrong if we assume that it
is largely a matter of indifference whether an individual snail is a
right-handed or a left-handed form, as far as its relation to the
environment is concerned. One form would have as good a chance
for existing as the other. If this is granted, we may conclude that,
while in most species a perfectly definite type is found, a right or a
left spiral, yet neither the one nor the other has been acquired on
account of its relation to the environment. This conclusion does not,
of course, commit us in any way as to whether the spiral form of the
visceral mass has been acquired in relation to the environment, but
only to the view that, if a spiral form is to be produced, it is
indifferent which way it turns. From the evolutionary point of view
this conclusion is of some importance, since it indicates that one of
the alternatives has been adopted and has become practically
constant in most cases without selection having had anything to do
with it.
Somewhat similar conditions are found in the flounders and soles.
As is well known, these fishes lie upon one side of the body on the
bottom of the ocean. Some species, with the rarest exceptions to be
mentioned in a moment, lie always on the right side, others on the
left side. A few species are indifferently right or left. At rare intervals
a left-sided form is found in a right-sided species, and conversely, a
right-sided form in a left-sided species. In such cases the reversed
type is as perfectly developed in all respects as the normal form, but
with a complete reversal of its right and left sides.
When the young flounders leave the egg, they swim in an upright
position, as do ordinary fishes, with both sides equally developed.
There cannot be any doubt that the ancestors of these fish were
bilaterally symmetrical. Therefore, within the group, both right-
handed and left-handed forms have appeared. It seems to me highly
improbable that if a right-handed form had been slowly evolved
through the selection of favorable variations in this direction, the end
result could be suddenly reversed, and a perfect left-sided form
appear. Moreover, as has been pointed out, the intermediate stages
would have been at a great disadvantage as compared with the
parent, and this would lead to their extermination on the selection
theory. If, however, we suppose that a variation of this sort appeared
at once, and was fixed,—a mutation in other words,—and that
whether or not it had an advantage over the parent form, it could
still continue to exist, and propagate its kind, then we avoid the
chief difficulty of the selection theory. Moreover, we can imagine, at
least, that if this variation appeared in the germ and was, in its
essential nature, something like the relation seen in the snail, the
occasional reversal of the relations of the parts presents no great
difficulty.
In this same connection may be mentioned a curious fact first
discovered by Przibram and later confirmed by others. If the leg
carrying the large claw of a crustacean be removed, then, at the
next moult, the leg of the other side that had been the smaller first
leg becomes the new big one; and the new leg that has regenerated
from the place where the big one was cut off becomes the smaller
one.
Wilson has suggested that both claws in the young crustacean
have the power to become either sort. We do not know what
decides the matter in the adult, after the removal of one of the
claws. Some slight difference may turn the balance one way or the
other, so that the smaller claw grows into the larger one. At any
rate, there is seen a latent power like that in the egg of the snail.
Zeleny has found a similar relation to exist for the big and the little
opercula of the marine worm, Hydroides.
Let us consider now the more general questions involved in these
symmetrical and asymmetrical relations between the organism and
its environment. In what sense, it may be asked, is the symmetry of
a form an adaptation to its environment? That the kind of symmetry
gives to the animal in many cases a certain advantage in relation to
its environment is so evident that I think it will not be questioned.
The main question is how this relation is supposed to have been
attained. Three points of view suggest themselves: First, that the
form has resulted directly from the action of the environment upon
the organism. This is the Lamarckian point of view, which we
rejected as improbable. Second, that the form has been slowly
acquired by selecting those individual variations that best suited it to
a given set of surrounding conditions. This is the Darwinian view,
which we also reject. The third, that the origin of the form has had
nothing to do with the environment, but appeared independently of
it. Having, however, appeared, it has been able to perpetuate itself
under certain conditions.
It should be pointed out that the Darwinian view does not
suppose that the environment actually produces any of the new
variations which it selects after they have appeared, but in so far as
the environment selects individual differences it is supposed to
determine the direction in which evolution takes place. On the
theory that evolution has taken place independently of selection, this
latter is not supposed to be the case; the finished products, so to
speak, are offered to the environment; and if they pass muster, even
ever so badly, they may continue to propagate themselves.
The asymmetrical form of certain animals living in a symmetrical
environment might be used as an argument to show that the
relation of symmetry between an animal and its environment can
easily be overstepped without danger. The enormous claw of the
fiddler-crab must throw the animal out of all symmetrical relation
with its environment, and yet the species flourishes. The snail carries
around a spiral hump that is entirely out of symmetrical relation with
the surroundings of a snail.
These facts, few though they are, yet suffice to show, I believe,
that the relation of symmetry between the organism and its
environment may be, and is no doubt in many cases, more perfect
than the requirements of the situation demand. The fact that
animals made unsymmetrical through injuries (as when a crab loses
several legs on one side, or a worm its head) can still remain in
existence in their natural environment, is in favor of the view that I
have just stated. By this I do not mean to maintain that a
symmetrical form does not have, on the whole, an advantage over
the same form rendered asymmetrical, but that this relation need
not have in all forms a selective value, and if not, then it cannot be
the outcome of a process of natural selection.
To sum up: it appears probable that the laws determining the
symmetry of a form are the outcome of internal factors, and are not
the result either of the direct action of the environment, or of a
selective process. The finished products and not the different
imperfect stages in such a process, are what the inner organization
offers to the environment. While the symmetry or asymmetry may
be one of the numerous conditions which determine whether a form
can persist or not, yet we find that the symmetrical relations may be
in some cases more perfect than the environment actually demands;
and in other cases, although the form may place the organism at a
certain disadvantage, it may still be able to exist in certain localities.
Mutual Adaptation of Colonial Forms
In the white ants, true ants, and bees, we find certain individuals
of the community specialized in such a way that their modifications
stand in certain useful relations to other members of the community.
Amongst the bees, the workers collect the food, make the comb,
and look after the young. The queen does little more than lay eggs,
and the drone’s only function is to fertilize the queen. In the true
ants there are, besides the workers and the queen and the males,
the soldier caste. These have large thick heads and large strong
jaws. On the Darwinian theory it is assumed that this caste must
have an important rôle to play, for otherwise their presence as a
distinct group of forms cannot be accounted for; but I do not believe
it is necessary to find an excuse for their existence in their supposed
utility. From the point of view of the mutation theory, their real value
may be very small, but so long as their actual presence is not
entirely fatal to the community they may be endured.
In regard to these forms, Sharp writes:[28] “The soldiers are not
alike in any two species of Termitidæ, so far as we know, and it
seems impossible to ascribe the differences that exist between the
soldiers of different species of Termitidæ to special adaptations for
the work they have to perform.” “On the whole, it would be more
correct to say that the soldiers are very dissimilar in spite of their
having to perform similar work, than to state that they are dissimilar
in conformity with the different tasks they carry on.” The soldiers
have the same instincts as the workers, and do the same kinds of
things to a certain extent. “The soldiers are not such effective
combatants as the workers are.” Statements such as these indicate
very strongly that the origin of this caste can have very little to do
with its importance as a specialized part of the community.
28. “The Cambridge Natural History,” Vol. V, 1895.
The differences between the castes have gone so far in some of
these groups that the majority of the members of the community
have even lost the power to reproduce their kind, and this function
has devolved upon the queen, whose sole duty is to reproduce the
different castes of which the community is composed. This
specialization carries with it the idea of the individuals being adapted
to each other, so that, taken all together, they form a whole, capable
of maintaining and reproducing itself. It does not seem that we must
necessarily look upon this union as the result of competition leading
to a death struggle between different colonies, so that only those
have survived in each generation that carried the work of
specialization one step farther. All that is required is to suppose that
such specialization has appeared in a group of forms living together,
and the group has been able to perpetuate itself. We do not find that
all other members of the two great groups to which the white ants
and true ants belong have been crowded out because these colonial
forms have been evolved. Neither need we suppose that during the
evolution of these colonial species there has been a death struggle
accompanying each stage in the evolution. If the members of a
colonial group began to give rise to different forms through
mutations, and if it happened that some of the combinations formed
in this way were capable of living together, and perpetuating the
group, this is all that is required for such a condition to persist.
The relation of the parents to the offspring presents in some
groups a somewhat parallel case to that of these colonial forms. Not
only are some of the fundamental instincts of the parents changed,
but structures may be present in the parents whose only use is in
connection with the young. The marsupial pouch of the kangaroo, in
which the immature young are carried and suckled, is a case in
point, and the mammary glands of the Mammalia furnish another
illustration.
Adaptations of these kinds are clearly connected with the
perpetuation of the race. In the case of the mammals the young are
born so immature that they are dependent on the parental organs,
just spoken of, for their existence. Could we follow this relation
through its evolutionary stages, it would no doubt furnish us with
important data, but unfortunately we can do no more than guess
how this relation became established. The changes in the young and
in the parent may have been intimately connected at each stage, or
more or less independent. If we suppose the mammary glands to
have appeared first, they might have been utilized by the young in
order to procure food. Their presence would then make it possible
for the young to be born in an immature condition, as is the case
with the young of many of the mammals. But this is pure guessing,
and until we know more of the actual process of evolution in this
case, it is unprofitable to speculate.
Degeneration
In almost every group of the animal kingdom there are forms that
are recognized as degenerate. This degeneration is usually
associated with the habitat of the animal. In many cases it can be
shown with much probability that these degenerate forms have
descended from members of the group that are not degenerate. We
find there is a loss of those organs that are not useful to the
organism in its new environment. The degeneration may involve
nearly the whole organization (except as a rule the reproductive
system), as seen in the tapeworm, or only certain organs of the
body, as the eyes in cave animals. A few examples will bring the
main facts before us.
A parasitic existence is nearly always associated with
degeneration. Under these conditions, food can generally be
obtained without difficulty, at the expense of the host, and
apparently associated with this there is a degeneration, and even a
complete loss of so important an organ as the digestive tract. Thus
the tapeworm has lost all traces of its digestive tract, absorbing the
already digested matter of its host through its body wall. Some of
the roundworms, that live in the alimentary tracts of other animals,
may have their digestive organs reduced. In Trichina, this
degeneration has gone so far that the digestive tract is represented,
in part, by a single line of endoderm cells, pierced by a cavity. The
digestive organs are also absent in certain male rotifers, which are
parasitic on the females, and these organs are also very degenerate
in the male of Bonellia, a gephyrean worm. A parasitic snail,
Entoscolax ludwigii, has its digestive apparatus reduced to a sucking
tube ending in a blind sac. The rest of the tract has completely
degenerated. The remarkable parasitic crustacean, Sacculina carcini,
looks like a tumor attached to the under surface of the abdomen of
a crab. It has neither mouth nor digestive tract, and absorbs
nourishment from the crab through rootlike outgrowths that
penetrate the body. From its development alone we know that it is a
degenerate barnacle.
There seems to be in all these cases an apparent connection
between the absence of the digestive tract and the presence of an
abundant supply of food, that has already been partly digested by
the host. Put in a different way, we may say that the presence of
this food has furnished the environment in which an animal may live
that has a rudimentary digestive tract.
An interesting case of degeneration is found in the rudimentary
mouth parts of the insects known as May-flies, or ephemerids. Some
of these species live in the adult condition for only a few hours, only
long enough to unite and deposit their eggs. In the adult stage the
insects do not take any food. In this case the degeneration is
obviously not connected with the presence of food, but apparently
with the shortness of the adult life.
One of the most familiar cases of degeneration is blindness,
associated with life in the dark. The most striking cases are those of
cave animals, but this is only an extreme example of what is found
everywhere amongst animals that live concealed during the day
under stones, etc. The blind fish and the blind crayfish of the
Mammoth Cave, the blind proteus of the caves of Carniola, the blind
mole that burrows underground, the blind larvæ of many insects
that live in the dark, are examples most often cited. Some nocturnal
animals, like the earthworm, have no eyes, although they are still
able to distinguish light; and some of the deep-sea animals, that live
below the depth to which light penetrates, have degenerate eyes.
The workers of some ants, that remain in the nests, are blind, but
the males and the queens of these forms have well-developed eyes,
although the eyes may be of use to them at only one short period of
their life, namely, at the time of the marriage flight. This fact is
significant and is underestimated by those who believe that disuse
accounts for the degeneration of organs.
The wings of the ostrich and of the kiwi are rudimentary
structures no longer used for flight, and many insects, belonging to
several different orders, have lost their wings, as seen in fleas, some
kinds of bugs, and moths, and even in some grasshoppers.
A curious case of degeneration is found in the abdomen of the
hermit crab, which is protected by the appropriated shell of a snail.
The appendages of one side of the abdomen have nearly
disappeared in the male, although in the female the abdominal
appendages are used to carry the eggs as in other decapod
crustaceans. The abdomen, instead of being covered by a hard
cuticle, as in other members of this group, is soft and unprotected
except by the shell of the snail.
Cases of these kinds could be added to almost indefinitely, and the
explanation of these degenerate structures has been a source of
contention amongst zoologists for a long time. The most obvious
interpretation is that the degeneration has been the result of disuse.
But as I have already discussed this question, and given my reasons
for regarding it as improbable that degeneration has arisen in this
way, we need not further consider this point here.
The selectionists have offered several suggestions to account for
degeneration. In fact, this has been one of the difficulties that has
given them most concern. They have suggested, for example, that
when an organ is no longer of use to its possessor it would become
a source of danger, and hence would be removed through natural
selection. They have also suggested that since such organs draw on
the general food supply they would place their possessor at a
disadvantage, and hence would be removed. Weismann has
attempted to meet the difficulty by his theory of “Panmixia,” or
universal crossing, by which means the useless structures are
imagined to be eliminated.
These attempts will suffice to point out the straits to which the
Darwinians have found themselves reduced, and we have by no
means exhausted the list of suggestions that have been made. Let
us see, if, on any other view, we can avoid some of the difficulties
that the selection theory has encountered.
In the first place we shall be justified, I think, in eliminating
competition as a factor in the process, since the admission that an
organ has become useless carries with it the idea that it has no
longer a selective value. If, in its useless condition, it is no longer
greatly injurious, as is probably, though not necessarily always, the
case, then selection cannot enter into the problem. If in parasitism
we assume that an animal finds a lodgement in another animal,
where it is able to exist, we may have the first stage of the process
introduced at once. If under these conditions a mutation appeared,
involving some of the organs that are no longer essential to the life
of the individual in its new environment, the new mutation may
persist. We need not suppose that the original form becomes
crowded out, but only that a more degenerate form has come into
existence. As a matter of fact we find in most groups, in which
degenerate forms exist, a number of different stages in the
degeneration in different species. Mutation after mutation might
follow until many of the original organs have disappeared. The
connection that appears to exist between the degeneration of a
special part and the environment in which the animal lives finds its
explanation simply in the fact that the environment makes possible
the existence of that sort of mutation in it. We do not know, as yet,
whether through mutative changes an organ can completely
disappear, although this seems probable from the fact that in a few
cases mutations are known to have arisen in which a given part is
entirely functionless. If we could assume that, a mutation in the
direction of degeneration being once established, further mutations
in the same direction would probably occur, the problem would be
much simplified; but we lack data, at present, to establish this view.
In the case of blind animals it seems probable that the transition
has taken place in such forms as had already established themselves
in places more or less removed from the light. Such forms as had
the habit of hiding away under stones, or in the ground, living partly
in and partly out of the light, might, if a mutation appeared of such
a sort that amongst other changes the eyes were less developed,
still be capable of leading an existence in the dark, while it might be
impossible for them to exist any longer with weakened vision in the
light. If such a process took place, the habitat of the new form
would be limited, or in other words it would be confined to the
locality to which it finds itself adapted; not that it has become
adapted to the environment through competition with the original
species, or, in fact, with any other.
Thus, from the point of view that is here taken, an animal does
not become degenerate because it becomes parasitic, but the
environment being given, some forms have found their way there; in
fact, we may almost say, have been forced there, for these
degenerate forms can only exist under such conditions.
In conclusion, this much at least can be claimed for the mutation
theory; that it meets with no serious difficulty in connection with the
phenomena of degeneration. It meets with no difficulty, because it
makes no pretence to explain the origin of adaptations, but can
account for the occurrence of degenerate forms, if it is admitted that
these appear as mutations, or as definite variations. Let us, however,
not close our eyes to the fact that there is still much to be explained
in respect to the degeneration of animals and plants. It is far from
my purpose to apply the mutation theory to all adaptations; in fact,
it will not be difficult to show that there are many adaptations whose
existence can have nothing directly to do with the mutation theory.
Protective Coloration
That many species of animals are protected by their resemblance
to their environment no one will probably deny. That we are ignorant
in all cases as to how far this protection is necessary for the
maintenance of the species must be admitted. That some of the
resemblances that have been pointed out have been given fictitious
value, I believe very probable.
Resemblance in color between the organism and its environment
has given to the modern selectionist some of his most valuable
arguments, but we should be on our guard against supposing that,
because an animal may be protected by its color, the color has been
acquired on this account. On the supposition that the animal has
become adapted by degrees, and through selection, we meet with
all the objections that have been urged, in general, against the
theory of natural selection. But if we assume here also that
mutations have occurred without relation to the environment, and,
having once appeared, determined in some cases the distribution of
the species, we have at least a simple hypothesis that appears to
explain the facts. If it be claimed that the resemblance is, in some
cases, too close for us to suppose that it has arisen independently of
the environment, it may be pointed out that it has not been shown
that such a close resemblance is at all necessary for the continued
existence of the species, and hence the argument is likely to prove
too much. For instance, the most remarkable case of resemblance is
that of Kallima, but in the light of a recent statement by Dean it may
be seriously asked whether there is absolute need of such a close
resemblance to a leaf. Even if it be admitted that to a certain extent
the butterfly is at times protected by its resemblance to a leaf, it is
not improbable that it could exist almost equally well without such a
close resemblance. If this is true, natural selection could never have
brought about such a close imitation of a leaf. Cases like these of
over-adaptation are not unaccountable on the theory of mutation,
for on this view the adaptation may be far ahead of what the actual
requirements for protection demand. We meet occasionally, I think,
throughout the living world with resemblances that can have no such
interpretation, and a number of the kinds of adaptations to be
described in this chapter show the same relation.
Some of the cases of mimicry appear also to fall under this head;
although I do not doubt that many so-called cases of mimicry are
purely imaginary, in the sense that the resemblance has not been
acquired on account of its relation to the animal imitated. There is
no need to question that in some cases animals may be protected by
their resemblance to other animals, but it does not follow, despite
the vigorous assertions of some modern Darwinians, that this
imitation has been the result of selection. Until it can be shown that
the imitating species is dependent on its close imitation for its
existence, the evidence is unconvincing; and even if, in some cases,
this should prove to be the case, it does not follow that natural
selection has brought about the result, or even that it is the most
plausible explanation that we have to account for the results. The
mutation theory gives, in such cases, an equally good explanation,
and at the same time avoids some of the difficulties that appear fatal
to the selection theory.
What has been said against the theory of mimicry might be
repeated in much stronger terms against the hypothesis of warning
colors.
It seems to me, in this connection, that the imagination of the
selectionist has sometimes been allowed to “run wild”; and while it
may be true that in some cases the colors may serve as a signal to
the possible enemies of the animal, it seems strange that it has been
thought necessary to explain the origin of such colors as the result
of natural selection. Indeed, some of these warning colors appear
unnecessarily conspicuous for the purpose they have to perform. In
other words, it does not seem plausible that an animal already
protected should need to be so conspicuous. If we stop for a
moment to consider what an enormous amount of destruction must
have occurred, according to Darwin’s theory, in order to bring this
warning coloration to its supposed state of perfection, we may well
hesitate before committing ourselves to such an extreme view.
That gaudy colors have appeared or been present in animals that
are protected in other ways is not improbable, when we consider the
rôle that color plays everywhere in nature. That the presence of
such colors may, to a certain limited extent, protect its possessor
may be admitted without in any degree supposing that natural
selection has directed the evolution of such color, or that it has been
acquired through a life and death struggle of the individuals of the
species.
Sexual Dimorphism[29] and Trimorphism
29. This term is used here in the sense employed by Darwin. The same term is
sometimes used for those cases in which the male departs very greatly from
the female in form.
It has been found in a few species of animals and plants that two
or more forms of one sex may exist, and here we find a condition
that appears to be far more readily explained on the mutation theory
than on any other. The most important cases, perhaps, are those in
plants, but there are also similar cases known amongst animals, and
these will be given first.
There is a North American butterfly, Papilio turnus, that appears
under at least two forms. In the eastern United States the male has
yellow wings with black stripes. There are two kinds of females, one
of which resembles the male except that she has also an orange
“eye-spot”; the other female is much blacker, and this variety is
found particularly in the south and west. The species is dimorphic,
therefore, mainly in the latter regions.
The cases of seasonal dimorphism offer somewhat similar
illustrations. The European butterfly, Vanessa levana-prorsa, has a
spring generation (levana) with a yellow and black pattern on the
upper surface of the wings. The summer generation (prorsa) has
black wings “with a broad white transverse band, and delicate yellow
lines running parallel to the margins.” These two types are sharply
separated, and their differences in color do not appear to be
associated with any special protection that it confers on the bearer.
These facts in regard to Vanessa seem to indicate that differences
may arise that are perfectly well marked and sharply defined, which
yet appear to be without any useful significance.
We meet with cases in which the same animal has at different
times of year different colors, as seen in the summer and winter
plumage of the ptarmigan. There is no direct evidence to show how
this seasonable change has been brought about; but from the facts
in regard to Vanessa we can see that it might have been at least
possible for the white winter plumage, for instance, to have
appeared without respect to any advantage it conferred on the
animal, but after it had appeared it may have been to a certain
degree useful to its possessor.

Fig. 5.—A, long-styled, and


B, short-styled, forms of Primula veris.
C, D, E, the three forms of the trimorphic flower of Lythrum salicaria,
with petals and calyx removed on near side. (After Darwin.)

Amongst plants there are some very interesting cases of


dimorphism and trimorphism in the structure of the flowers. Darwin
has studied some of these cases with great care, and has made out
some important points in regard to their powers of cross-fertilization.
[30]
The common European cowslip, Primula veris, var. officinalis, is
found under two forms, Figure 5 A and B, which are about equally
abundant. In one the style is long so that the stigma borne on its
end comes to the top of the tube of the corolla. The stamens in this
form stand about halfway up the tube. This is called the long-styled
form. The other kind, known as the short-styled form, has a style
only half as long as the tube of the corolla, and the stamens are
attached around the upper end of the tube near its opening. In
other words, the position of the end of the style (the stigma) and
that of the stamens is exactly reversed in the two forms. The corolla
is also somewhat differently shaped in the two forms, and the
expanded part of the tube above the stamens is larger in the long-
styled than in the short-styled form. Another difference is found in
the stigma, which is globular in the long-styled, and depressed on its
top in the short-styled, form. The papillæ on the former are twice as
long as those on the short-styled form. The most important
difference is found in the size of the pollen grains. These are larger
in the long-styled form, being in the two cases in the proportion of
100 to 67. The shape of the grains is also different. Furthermore, the
long-styled form tends to flower before the other kind, but the short-
styled form produces more seeds. The ovules in the long-styled
form, even when unfertilized, are considerably larger than those of
the short-styled, and this, Darwin suggests, may be connected with
the fact that fewer seeds are produced, since there is less room for
them. The important point for our present consideration is that
intermediate forms do not exist, although there are fluctuating
variations about the two types. Moreover, the two kinds of flowers
never appear on the same plant.

You might also like