Computer Animation Algorithms and Techniques
Total Page:16
File Type:pdf, Size:1020Kb
Computer Animation Algorithms and Techniques Rick Parent Team LRN Executive Editor Diane D. Cerra Publishing Services Manager Scott Norton Assistant Developmental Editor Belinda Breyer Editorial Assistant Ramona Buehler Cover Design Ross Carron Design Text Design Mark Ong, Side by Side Studios Supplementary Technical Illustration Tom Webster, LineWorks Composition Nancy Logan Copyeditor Sheila Berg Proofreader Karen Stough Indexer Ty Koontz Printer Courier Corporation Cover Images (from top): Detail of still from Geri’s Game, courtesy Pixar Studios; simulation of volcano spitting fire, courtesy Katie Boner and Barb Olsafsky; simulation of waves hitting shore, courtesy Arun Somasundaram; “Bragger in Beantown,” cour- tesy John Chadwick; robot, courtesy Jessica Hodgins; facial model, courtesy Scott King; driving simulation, courtesy Norm Badler Interior Images: Figures 5.26 and 5.27 (plates 4 and 5), courtesy David S. Ebert; Figure 5.28 (plate 6) courtesy Ruchir Gatha and David S. Ebert; figure 6.26, courtesy David S. Ebert; figures 6.28 and 6.31, courtesy Frederic I. Parke; figure 6.39, “Face and 2d Mesh,” reprinted from Signal Processing: Image Communication 15, nos. 4-5 (Tekalp, 2000): pp. 387-421, by permission of Elsevier Science; figure A.3 (plate 11), courtesy Disney Enterprises, Inc.; figure A.11 (plate 12), courtesy Pixar Studios, all rights reserved; figure A.12 (plate 13), courtesy Disney Enterprises, Inc.. The Random Number Generator discussed in appendix section B.5.3 is free software that can be redistributed and/or modified under the terms of the GNU Library General Public License as published by the Free Software Foundation. This library is distrib- uted free of charge but without warranty, even the implied warranties of merchantability or fitness for a particular purpose. For details, see the GNU Library General Public License posted at http://www.fsf.org/copyleft/library.txt. Designations used by companies to distinguish their products are often claimed as trademarks or registered trademarks. In all instances in which Morgan Kaufmann Publishers is aware of a claim, the product names appear in initial capital or all capital let- ters. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and regis- tration. Morgan Kaufmann Publishers 340 Pine Street, Sixth Floor, San Francisco, CA 94104-3205, USA http://www.mkp.com ACADEMIC PRESS A Harcourt Science and Technology Company 525 B Street, Suite 1900, San Diego, CA 92101-4495, USA http://www.academicpress.com Academic Press Harcourt Place, 32 Jamestown Road, London, NW1 7BY, United Kingdom http://www.academicpress.com © 2002 by Academic Press All rights reserved Printed in the United States of America 06 05 04 03 02 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means—elec- tronic, mechanical, photocopying, or otherwise—without the prior written permission of the publisher. Library of Congress Control Number: 2001090620 ISBN: 1-55860-579-7 This book is printed on acid-free paper. Team LRN To Mom and Dad To John and Kim for teaching me to keep things in perspective Team LRN Team LRN Foreword........................................................................... xv Preface .............................................................................. xvii Overview ..................................................................................... xvii Organization of the Book .......................................................... xx Acknowledgments ..................................................................... xxi References ................................................................................. xxii 1 Introduction ................................................................... 1 Perception .................................................................................. 2 The Heritage of Animation ........................................................ 4 Early Devices ......................................................................... 4 The Early Days of ˇConventional Animation.......................... 6 Disney .................................................................................... 7 Contributions of Others .......................................................... 9 Other Media for Animation ..................................................... 9 Principles of Computer Animation .......................................... 10 Animation Production ............................................................... 12 Computer Animation Production Tasks .................................. 15 Digital Editing ......................................................................... 17 Digital Video ........................................................................... 20 A Brief History of Computer Animation................................... 21 Early Activity........................................................................... 21 The Middle Years ................................................................... 24 Chapter Summary ...................................................................... 29 References ................................................................................. 29 Spaces and Transformations ................................................... 31 2 Technical Background ................................................. 31 The Display Pipeline.................................................................. 32 Homogeneous Coordinates and the Transformation Matrix .......................................................................................... 36 Team LRN Compounding Transformations: Multiplying Transformation Matrices ........................................................... 39 Basic Transformations .............................................................. 40 Representing an Arbitrary Orientation .................................... 42 Extracting Transformations from a Matrix .............................. 45 Description of Transformations in the Display Pipeline ........ 46 Round-off Error Considerations............................................... 48 Orientation Representation ...................................................... 51 Fixed Angle Representation ................................................... 53 Euler Angle Representation ................................................... 56 Angle and Axis ....................................................................... 57 Quaternions ............................................................................ 58 Chapter Summary ...................................................................... 61 References ................................................................................. 61 Interpolation ............................................................................... 63 3 Interpolation and Basic Techniques ........................... 63 The Appropriate Function......................................................... 64 Controlling the Motion Along a Curve ..................................... 68 Computing Arc Length............................................................ 69 Speed Control ........................................................................ 84 Ease-in/Ease-out .................................................................... 86 Constant Acceleration: Parabolic Ease-In/Ease-Out.............. 89 General Distance-Time Functions.......................................... 92 Curve Fitting to Position-Time Pairs....................................... 94 Interpolation of Rotations Represented by Quaternions ....... 97 Path Following ........................................................................... 102 Orientation along a Path......................................................... 102 Smoothing a Path ................................................................... 108 Determining a Path along a Surface ...................................... 114 Key-Frame Systems .................................................................. 116 Animation Languages ............................................................... 120 Team LRN Artist-Oriented Animation Languages .................................... 121 Articulation Variables.............................................................. 122 Graphical Languages ............................................................. 123 Actor-Based Animation Languages ........................................ 123 Deforming Objects..................................................................... 124 Warping an Object.................................................................. 125 Coordinate Grid Deformation ................................................. 125 Morphing (2D) ............................................................................ 143 Coordinate Grid Approach...................................................... 143 Feature-Based Morphing........................................................ 148 3D Shape Interpolation.............................................................. 153 Matching Topology ................................................................. 157 Star-Shaped Polyhedra .......................................................... 157 Axial Slices ............................................................................. 159 Map to Sphere........................................................................ 160 Recursive Subdivision