Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Foundation HTML5 animation with JavaScript
Lamberta B., Peters K., Friends of ED, Berkeley, CA, 2011. 504 pp. Type: Book (978-1-430236-65-8)
Date Reviewed: Mar 9 2012

Despite my first impression that this book is only for experienced programmers, any patient reader can heed the authors’ suggestions and derive considerable benefits from studying it. This book provides a solid background on the mathematics, physics, and programming concepts and techniques required to build simulations of real-world situations and other applications involving animation. It is excellent at the really hard stuff, explaining topics such as trigonometry, equations of motion, kinematics, 3D modeling, lighting models, and collision detection. Each chapter starts with a list of what will be covered and often a review of related concepts covered in the previous chapters, and ends with listings of important formulas and a summary.

The book is divided into five parts. Part 1, “JavaScript Animation Basics,” starts with chapter 1’s short but solid grounding in the idea of animation. Chapter 2 is a quick overview of Hypertext Markup Language 5 (HTML5) structure, JavaScript objects, events, and debugging using the Web console. In this chapter (and other chapters), the authors indicate ways to address inconsistencies in support of the new HTML5 features. The text, which is supported by the available downloads, describes the technique of defining a utils library to contain the code for handling browser differences and other utility-type coding. For example, requestAnimationFrame is the window method proposed for building animation loops, and a function defined in the utils library provides alternatives and backup coding using setTimeout. Chapter 3, “Trigonometry for Animation,” is written for someone who has forgotten the topic and may even be afraid of it. Chapter 4, “Rendering Techniques,” is an excellent introduction to hexadecimal color-coding and the canvas drawing application programming interface (API).

Part 2, “Basic Motion,” contains three chapters. In this part, as well as later in the book, the authors move painlessly between a conceptual level and a detailed coding level of explanation. The authors frequently describe what can go wrong with an obvious implementation and tradeoffs between an easy approach to coding versus a more complex one.

Part 3, “Advanced Motion,” consists of seven chapters. Though the underlying mathematics (and physics) gets more challenging, and the authors probably overdo telling readers that they “should” understand things, the text still features smooth transitions from conceptual, even folksy explanations to straight code.

Part 4, “3D Animation,” has three chapters. I missed reading the terms “projection” and “hidden line/hidden surface,” but the exposition is clear. As with Part 3, the mathematics is challenging; however, the authors make artful use of a small amount of space to address substantial topics. They also provide code that readers can build on to make powerful applications. Building up the display of the 3D letter “A” is especially helpful.

Part 5, “Additional Techniques,” is the final section (two chapters). Chapter 18, “Matrix Math,” may be the weakest in the text. A full explanation of the canvas transformation methods would have been appropriate to include here or earlier. The book concludes with a great final chapter, “Tips and Tricks.” Indeed, it is a grab bag of tricks, including a thoughtful exposition on placing objects randomly with some constraints and a discussion of different ways to do animation, comparing the frame-based approach used in the rest of the book with timer (using setInterval) and time (using setInterval along with an exact calculation of elapsed time). The single appendix repeats the critical formulas.

There is very little to criticize about the book. More screen shots would have been welcomed, though static pictures are limited in what they can convey and the authors provide easy access to running versions of the examples on the publisher’s Web site (http://www.apress.com/9781430236658). There are only a few typographical errors. It can be argued that pushing the browser dependencies into external script files, while standard professional practice, may cloud the reader’s understanding of which features are current HTML5 and which are supplied by the authors. The text certainly contains long sections of mostly uncommented code, but the authors build up each example systematically, make use of spacing, and set new statements in bold type. The names for variables, objects, and methods are evocative.

In summary, anyone who wants to develop applications featuring animation and other simulations of physical effects using HTML5, JavaScript, and other programming environments should buy and read this book.

Reviewer:  Jeanine Meyer Review #: CR139962 (1208-0804)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Animation (I.3.7 ... )
 
 
HTML (I.7.2 ... )
 
 
Javascript (D.3.2 ... )
 
 
Language Classifications (D.3.2 )
 
Would you recommend this review?
yes
no
Other reviews under "Animation": Date
Making them move
Badler N., Barsky B., Zeltzer D., Morgan Kaufmann Publishers Inc., San Francisco, CA, 1991. Type: Book (9781558601062)
Jul 1 1992
Computer animation primer
Fox D., Waite M., McGraw-Hill, Inc., New York, NY, 1984. Type: Book (9789780070217423)
Mar 1 1985
High speed animation and simulation for microcomputers
Adams L., TAB Books, Blue Ridge Summit, PA, 1987. Type: Book (9789780830628599)
Aug 1 1988
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy