Game Physics , David H. Eberly Morgan Kaufmann/Elsevier, San Francisco, 2004. $69.95 (776 pp.). ISBN 1-55860-740-4, CD-ROM
Although computer graphics researchers have long made reference to physical principles, only recently has physics assumed a prominent place in graphics textbooks. Increases in processor power now make it feasible to run complex physical simulations in real time, which greatly increases their practical importance. Thus there is an increasing need for books like David Eberly’s Game Physics that can give graphics programmers a grounding in the physical principles that underlie realistic computer animation. The standard computer graphics textbook is the second edition of Computer Graphics: Principles and Practice (Addison-Wesley, 1995), written for programming in C, by James Foley, Andries van Dam, Steven Feiner, and John Hughes; that book, in contrast, makes only passing reference to physics-based simulation. Eberly has worked on physics engines (that is, software packages that calculate the dynamics of physical systems) that have been incorporated into some popular game titles and has written other game-engine texts, so he has the appropriate background for writing such a book.
At the heart of most modern physics engines is a simulation of the dynamics of rigid bodies. In the typical approach, the programmer determines the mass of each body in the system, identifies the forces and torques applied to each body, uses differential equations to specify the changes in position and orientation of the bodies in accordance with Newtonian dynamics, and then uses a numerical differential equation solver to compute the motion over time. In the case of bodies colliding, the engine must determine exactly when and where the collision occurs so that the dynamics of the collisions can be properly modeled.
Before presenting these simulation algorithms, Eberly covers the underlying classical mechanics in some depth. He shows how Lagrangian dynamics and Euler’s equations can be used to model the motion of bodies under constraints, and analyzes a number of examples of such systems. Unfortunately, Eberly must present a lot of physics before the reader gets to any algorithms for computing motion. As I read the physics exposition, I found myself reaching for the CD that is included in the book to get a better sense of how the physics was actually going to be used.
There are still limits to how far one can go with physical simulations on commodity game hardware. It is difficult to model the dynamics of deformable bodies in real time, and programmers must resort to various tricks that are not physically based but give the impression of realism. For example, one can squash and stretch objects to give the appearance of elastic deformations during collisions. Although such techniques are necessary, Eberly’s presentation of them seems out of place in a book that otherwise places such a heavy emphasis on physical principles. In any case, the techniques that Eberly describes do not yield very convincing results.
In other parts of the book, Eberly could have included more physics, not less. For example, the physics of illumination and reflection is increasingly important for games. Eberly describes techniques using common graphics cards to achieve various shading effects but explains the underlying physics only briefly. Nothing is wrong with that approach, but it is a surprising contrast to Eberly’s in-depth treatment of rigid-body dynamics.
The book’s organization makes it difficult to read from cover to cover. The mathematics and numerical analysis required to understand the physics simulations are appended at the end. Granted, it is hard to predict what material a given reader will need to review when approaching a topic such as this, but I think Eberly could have done a better job. For instance, the chapter on rigid-body simulation makes passing reference to quaternions, a famously difficult topic in computer graphics. The author’s brief mention of the mathematics makes it necessary for the reader to skip ahead to the chapter dealing with that topic.
The figures in the book suffer from a number of problems. They lack realism and visual appeal, which is always a concern for a computer graphics text. A few renderings from commercial games that employ physics-based techniques would have helped illustrate the descriptions. Many of the images are difficult to make out in black and white. Moreover, the illustrations are not always consistent with the text that they accompany.
For readers who are more concerned with the basic practicalities of physics-engine programming, an alternative is Physics for Game Developers (O’Reilly, 2001), by David M. Bourg. Overall, Game Physics contains useful reference material for game-engine developers, but readers are likely to pick and choose the parts of the book that are of interest to them.