Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Physics for JavaScript games, animation, and simulations : with HTML5 Canvas
Ramtal D., Dobre A., Apress, Berkeley, CA, 2014. 508 pp. Type: Book (978-1-430263-37-1)
Date Reviewed: Aug 27 2014

This book delivers on the promise of the blurb on the front cover: “Build real physics into your HTML5 projects.” The authors instruct the reader on the physics concepts necessary for modeling a wide variety of real-world phenomena. They also explain critical mathematical concepts. Though the authors state that they are not teaching programming, their examples and explanations demonstrate and provide instruction in good, object-oriented programming practices. I may not be willing to give the book away, but I will share it with computer science and new media teachers and students working on games and simulations, as well as colleagues teaching physics and numerical analysis.

The authors construct and build on a considerable amount of code. I applaud their decision to stick to plain JavaScript, without libraries, except and until they focus on 3D in the next-to-last chapter. For this, they make use of three.js with its use of WebGL. The code is available on a website that includes links to other useful sites.

The book is well organized as a whole and within each chapter. It is divided into four parts. Part 1, “The Basics,” introduces the general approach of modeling, and the core concepts in physics, animation, JavaScript, and mathematics. For example, chapter 3 describes difference equations.

Part 2, “Particles, Forces, and Motion,” starts with Newton’s laws, and continues with simulations demonstrating gravity, friction, and other forces. The authors explain why a feather does take longer to fall than a hammer, something my initial introduction to physics omitted. More generally, the book addresses common misconceptions and explains how certain shortcuts can be made in terms of the models. The examples include balloons, parachutes, airplanes, bungee jumping, and a car moving around a bend with the potential to skid. The last chapter in this part introduces the concept of a force field.

A systematic approach to the modeling of collisions is explored in the beginning of Part 3, “Multi-Particle and Extended Systems.” This includes attention to the “tunneling” problem, for example, when the parameters of the simulation allow an object to appear to jump out of the box. The featured example is molecules bouncing off each other and off walls. The next chapter focuses on what they define as particle systems. The resulting examples include simulations of fireworks and galaxies. The last chapter in this part, “Extended Objects,” addresses rigid objects that can change orientation and deformable bodies, such as clothes, and can be modeled as systems of objects.

In Part 4, “Building More Complex Simulations,” the first chapter focuses on two important mathematical topics: numerical accuracy and model scale. The authors describe and compare different approaches to numerical integration. The next chapter focuses on 3D and, as indicated earlier, makes use of the three.js library. The last chapter describes three simulations: a 2D submarine, a 3D flight simulator, and a model of the solar system.

I struggle to find anything negative about the book. The authors didn’t explain “this”; did not show the user interaction code for bungee jumping; and made no attempt to address responsive design for mobile devices. These are unwarranted complaints. The book is excellent.

Reviewer:  Jeanine Meyer Review #: CR142660 (1412-1004)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Object-Oriented Programming (D.1.5 )
 
 
Javascript (D.3.2 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Object-Oriented Programming": Date
Object-oriented programming systems, languages, and applications
Paepcke A.  Object-oriented programming systems, languages, and applications,Phoenix, AZ,Oct 6-Oct 11, 1991,1991. Type: Whole Proceedings
Oct 1 1992
Object lifecycles
Shlaer S., Mellor S., Yourdon Press, Upper Saddle River, NJ, 1992. Type: Book (9780136299400)
Apr 1 1993
Object-oriented programming
Voss G., Osborne/McGraw-Hill, Berkeley, CA, 1991. Type: Book (9780078816826)
Oct 1 1992
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