2007 • 283 Pages • 2.81 MB • English

Posted April 14, 2020 • Uploaded
by esperanza.stiedemann

PREVIEW PDF

Page 1

Transformations and Projections in Computer Graphics

Page 2

David Salomon Transformations and Projections in Computer Graphics

Page 3

Professor David Salomon (emeritus) Computer Science Department California State University Northridge, CA 91330-8281 USA Email: [email protected] Cover illustration: Adapted from figure 4.25, courtesy of Ari Salomon. British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Library of Congress Control Number: 2006923906 ISBN-10: 1-84628-392-2 ISBN-13: 978-1-84628-392-5 Printed on acid-free paper © Springer-Verlag London Limited 2006 Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms of licences issued by the Copyright Licensing Agency. Enquiries concerning reproduction outside those terms should be sent to the publishers. The use of registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant laws and regulations and therefore free for general use. The publisher makes no representation, express or implied, with regard to the accuracy of the information contained in this book and cannot accept any legal responsibility or liability for any errors or omissions that may be made. Printed in the United States of America (EB) 9 8 7 6 5 4 3 2 1 springer.com

Page 4

Dedicated to Dick Termes, whose work and talent have contributed much to the quality of this book. If there’s a book you really want to read, but it hasn’t been written yet, then you must write it. —Toni Morrison

Page 5

Preface It is probably a coincidence that the three main terms discussed in this book, namely transformations, projections, and perspective, are ambiguous. Here is what the dictio- nary has to say about these terms. Transformation (a) The act or an instance of transforming. (b) The state of being transformed. A marked change, as in appearance or character, usually for the better. Mathematical transformation. (a) Replacing a variable in an expression by its value. (b) Mapping a mathematical space onto another or onto itself. In geometry. Moving, rotating, reﬂecting, or otherwise systematically deforming a geometric ﬁgure (discussed in this book). In linguistics. (a) A rule to convert a syntactic form into another. (b) A sentence or sentential form derived by such a rule; a transform. In genetics. (a) The change undergone by a cell upon infection by a cancer-causing virus. (b) The alteration of a bacterial cell caused by the transfer of DNA from another bacterial cell, especially a pathogen. Projection The act of projecting or the condition of being projected. (a) An object or part thereof that extends outward. (b) Spiky projections on top of a fence. (c) A projection of land along the coast. A prediction or an estimate of a future situation, based on current data or trends. (a) The process of projecting a recorded image onto a viewing surface. (b) An image so projected. In mathematics. The image of an n-dimensional geometric ﬁgure reproduced in n−1 or fewer dimensions. The most common case is for n = 3 (discussed in this book).

Page 6

viii Preface In psychology. The attribution of one’s own beliefs or suppositions to others (such as when a scientist projects his beliefs into the subjects of his research or into theories he develops). Perspective (a) A view or scene. (b) A mental view or outlook. The appearance of objects in depth as perceived by normal binocular vision. (a) The relationship of aspects of a subject to each other and to a whole, “let’s put this into perspective.” (b) Subjective evaluation of relative signiﬁcance, “in my perspective as an electrician, this wire is defective.” (c) The ability to perceive things in their actual interrelations or comparative importance “in perspective, this ﬂood is minor.” The technique of representing three-dimensional objects and depth relationships on a two-dimensional surface (discussed in this book). (Adjective) Of, relating to, seen, or represented in perspective. This is why writing is such a liberating thing. You get to know what you didn’t know you knew. —Richard Lederer There is no question that computer graphics has become an important ﬁeld that pervades our lives in many areas. Many advertisements on television and in magazines are graphical and are created on computers. The screens of computers, PDAs, cellular telephones, and similar devices interact graphically with the user. More and more full- length feature ﬁlms are being created entirely by computers. Graphics software enables users to draw engineering plans, to create technical and artistic illustrations, and to develop fonts of text. (For a short history of computer graphics, see [hocg 06].) Computer graphics is an immense discipline, encompassing many ﬁelds, but this book concentrates on the three key terms mentioned above. Following is a short discus- sion of each term. The term “transformation” as discussed in this book refers to a geometric opera- tion applied to all the points of an object. An object may be moved, rotated, or scaled (shrunk or stretched). It may be reﬂected about a plane (as in a mirror) or deformed in some way, as illustrated by Figures Intro.1 and 1.1. Several transformations may be combined and may completely change the position, orientation, and shape of the object. Many graphics operations are greatly simpliﬁed with the help of transforma- tions. A forest can be created from a single tree by duplicating the tree several times and moving and transforming each copy diﬀerently. An object can be animated by moving it along a path in small steps while also rotating and scaling it slightly at each step. Transformations, both two-dimensional and three-dimensional, are discussed in Chapter 1. Currently, virtually all our graphics output devices are two dimensional, but many graphics projects and objects are three-dimensional. Converting a three-dimensional graphics object or scene into two dimensions is a mathematical operation called projec- tion. In general, a projection transforms an object from n dimensions to n− 1 or fewer

Page 7

Preface ix dimensions, but in computer graphics n is always 3. Because of the loss of dimensions, an object loses some of its details when projected. It is therefore important to study the various types of projections and always use the right one. Chapters 2 through 4 describe the three main classes of projections: parallel, perspective, and nonlinear. ⋄ Exercise Pre.1: Discuss the impossible fork of Figure Pre.1. Figure Pre.1: An Impossible Fork. Perspective (or more accurately, linear perspective) is the general name of several techniques that create the illusion of depth in a two-dimensional drawing. The rules of perspective determine where and how to place objects in a painting or drawing so that they appear to have depth and seem to be at the correct distance from the observer. A picture in perspective creates in the viewer’s brain the same sensation as the original three-dimensional scene. The main tool employed by linear perspective is vanishing points. Perspective, including its history, its use in art, its applications to computer graphics, and its mathematical representation, is the topic of Chapter 3. Following is a short description of the chapters and appendices of the book. Chapter 1 introduces geometric transformations. Both two-dimensional and three- dimensional transformations are included, and it is shown that the latter are more plentiful and more complex than the former and are also more diﬃcult to specify. A good example is rotations. In two dimensions there are only two directions, clockwise and counterclockwise, for a rotation and rotations are performed about a point. In three dimensions, rotations are about an axis and the terms clockwise and counterclockwise are ambiguous. Fortunately, all the important two-dimensional transformations can be speciﬁed by a 3×3 transformation matrix, and this matrix is easy to extend to the three-dimensional case, where all the important transformations can be speciﬁed by means of a 4×4 matrix. Thus, the use of a transformation matrix is elegant and leads to a deep understanding of transformations. Other topics discussed in this chapter are (1) the use of homogeneous coordinates, (2) combinations of transformations, such as a rotation followed by a reﬂection, and (3) transforming the coordinate system instead of the object. The remainder of the book is devoted to projections, and Chapter 2 introduces parallel projections. These are used mostly in engineering drafting but can also be found in Eastern art. There are three classes of parallel projections: orthographic, axonometric, and oblique (although it is shown at the end of this chapter that the last two types are similar). An orthographic projection displays one side or one face of the

Page 8

x Preface object. The downside of this type is that three projections are needed in order to see the entire object. On the other hand, it is easy to compute dimensions of object details from measurements made on the projection. Axonometric projections normally show three sides of the object. Thus, a single projection shows more of the object, but it is more diﬃcult to compute dimensions of parts of the object because each face of the object may be shrunk by a diﬀerent factor when drawn in the projection. Oblique projections are similar to axonometric projections and employ certain pro- jection angles in order to simplify the process of measuring and computing dimensions. Perspective projections are the topic of Chapter 3. The chapter starts with an intuitive explanation of the important concept of vanishing points. It follows with a short history of perspective, its origins, and its applications to art. The short but im- portant Section 3.3 is devoted to perspective projection in curved objects, a topic that is neglected by most texts on perspective. The bulk of the chapter develops the math- ematics of perspective in a systematic way, approaching this topic from several points of view and illustrating it with examples. The chapter ends with a long presentation of stereoscopic images, an important application of perspective. Chapter 4 treats the important (and alas neglected) topic of nonlinear projections. The most important nonlinear projections are the ﬁsheye projection (Section 4.2), the panoramic projection (Section 4.4), and the many sphere projections (Section 4.14). In addition, this chapter includes material and examples on circle inversion (Section 4.3), six-point perspective (Section 4.8), panoramic cameras (Section 4.10), telescopic and microscopic projections (Sections 4.11 and 4.12), and anamorphosis (Section 4.13). Appendix A, on vector products, and Appendix B, on quaternions, provide infor- mation on these mathematical topics that may be unfamiliar to some readers. Finally, Appendix C consists of color ﬁgures. The heart of mathematics consists of concrete examples and concrete problems. —Paul Halmos, How to Write Mathematics (1973). I have collected and developed the material in this book over many years of studying and teaching. Some of it has been published in [Salomon 99] and in various class notes, but most of it is seeing the light of day for the ﬁrst time in this book. I hope the readers will ﬁnd the presentation clear and unambiguous and will immediately bring any errors, omissions, and misprints to my attention. I cannot tell my learned reader (whose eyebrows, I suspect, have by now traveled all the way to the back of his bald head), I cannot tell him how the knowledge came to me. —Vladimir Nabokov, Lolita (1955). Readership of the Book This book is aimed mostly at mathematically mature readers (i.e., those who can deal comfortably with mathematical abstractions), who are familiar with computers and

Page 9

Preface xi computer graphics and are looking for a mathematically easy presentation of the trans- formations and projections used in computer graphics. The material presented here requires no previous knowledge of transformations, projections, or perspective. The key ideas are introduced slowly, are examined, whenever possible, from several points of view, and are illustrated by ﬁgures, examples, and (solved) exercises. The discussion must involve some mathematics, but it is nonrigorous and therefore easy to grasp. The mathematical background required is the basics of linear algebra, mostly vectors, vector operations, and matrices. The following features enhance the usefulness of the book: The book has many ﬁgures. It is my belief that a book on aspects of graphics should have ﬁgures to illustrate the concepts under discussion. Drawings, paintings, and photographs are included. Most color ﬁgures have been printed in place in grayscale. All of them appear in color in Appendix C. Many exercises are sprinkled throughout the text. These are important and should be worked out. The answers are also provided, but should be consulted only to verify the reader’s own answer, or as a last resort. Learn from other people’s mistakes. Life isn’t long enough to make them all yourself. —Harry S. Truman Books and Internet resources for transformations and projections. Godel, Escher, Bach: An Eternal Golden Braid, by Douglas Hofstadter. Basic Books, 20th Anniversary edition, 1999. This classical volume discusses symmetries in art, literature, and science. Transformation Geometry: An Introduction to Symmetry, by George E. Martin. Springer-Verlag, 1982. An excellent mathematical reference. Symmetry Discovered: Concepts and Applications in Nature and Science, by Joe Rosen. Dover Press, 1975. An accessible introduction to the ideas of symmetry. The New Ambidextrous Universe, by Martin Gardner. W. H. Freeman and Com- pany, 1990. A beautifully written exploration of symmetry. Symmetry, by Hermann Weyl. Princeton University Press, 1952. A classic illus- trated introduction to symmetry. The Renaissance and Rediscovery of Linear Perspective, by Samuel Y. Edgerton. Harper and Row, 1976 (especially chapters 9 and 18). Secret Knowledge: Rediscovering the Lost Techniques of the Old Masters, by David Hockney. Viking, 2001. The Science of Art, Optical Themes in Western Art From Brunelleschi to Seurat, by Martin Kemp. Yale University Press, 1990. The Life of Brunelleschi, by Antonio Tuccio Manetti, edited by Howard Saalman. Penn State University, 1970. Geometry: An Investigative Approach, and Laboratory Investigations in Geometry, by Phares G. O’daﬀer and Stanley R. Clemens. Addison-Wesley, 1976. Reference [Wolfram 06] has information, examples of, and code to create many panoramic projections and map projections. Reference [handprint 06] has a detailed discussion titled “Elements of Perspective.”

Page 10

xii Preface Currently, the book’s Web site is part of the author’s Web site, which is located at http://www.ecs.csun.edu/~dsalomon/. Domain name DavidSalomon.name has been reserved and will always point to any future location of the Web site. The author’s email address is [email protected], but any email sent to email address ⟨anyname⟩@DavidSalomon.name will reach the author. This book is dedicated to Dick Termes whose work and talent have contributed much to the quality of the book. The many images by Dick that are included in the book serve to illustrate important concepts. In addition, I would like to thank Ari Salomon for Figure 4.25 and Professor Shinji Araya, Fukuoka Institute of Technology, for Figure 4.32. Lakeside, California David Salomon The university as a step to anything but ordination seemed, to this man of ﬁxed ideas, a preface without a volume. —Thomas Hardy, Tess of the d’Urbervilles (1891)

Transformations and Projections in Computer Graphics

2006 • 283 Pages • 2.81 MB

Transformations and Projections in Computer Graphics

2006 • 283 Pages • 5.05 MB

Transformations and Projections in Computer Graphics

2006 • 283 Pages • 4.68 MB

COMPUTER GRAPHICS COURSE Transformations

2016 • 81 Pages • 2.79 MB

Confluence of Computer Vision and Computer Graphics

2000 • 352 Pages • 892 KB

Advanced Graphics with the IBM Personal Computer

1985 • 291 Pages • 22.88 MB

Lecture 5: Modeling shapes and surfaces, projections and transformations

2016 • 118 Pages • 20.77 MB

Computer Graphics Using Java - CIS Personal Web Pages

2002 • 287 Pages • 3.26 MB

Computer Graphics, C Version (2nd Ed.) - Lia/ufc

2002 • 662 Pages • 20.16 MB

Computer Graphics and Visualisation - Lighting and Shading

2016 • 94 Pages • 703 KB

Computer Graphics and Multimedia : Applications, Problems and Solutions

2004 • 283 Pages • 4.54 MB

Rotation transforms for computer graphics

2011 • 250 Pages • 1.68 MB

Rotation Transforms for Computer Graphics

2011 • 250 Pages • 1.95 MB

Rotation Transforms for Computer Graphics

2011 • 249 Pages • 1.99 MB

Fundamentals of Computer Graphics, Fourth Edition

2016 • 737 Pages • 17.17 MB