Apress

Physics for JavaScript Games, Animation, and Simulations

with HTML5 Canvas

By Dev Ramtal , Adrian Dobre

Physics for JavaScript Games, Animation, and Simulations Cover Image

Physics for JavaScript Games, Animation, and Simulations teaches JavaScript programmers how to incorporate real physics into their HTML5 games, animations, and simulations.

Full Description

  • ISBN13: 978-1-4302-6337-1
  • User Level: Intermediate to Advanced
  • Publishing May 6, 2014, but available now as part of the Alpha Program
  • Available eBook Formats: EPUB, MOBI, PDF
  • Print Book Price: $49.99
  • eBook Price: $34.99

Related Titles

Full Description

Have you ever wanted to include believable, solid interactivity in your games and projects to give them that extra edge? Physics for JavaScript Games, Animation, and Simulations teaches you how to incorporate real physics, such as gravity, friction, and buoyancy, into your HTML5 games, animations, and simulations. It also includes more advanced topics, such as particle systems, which are essential for creating effects such as sparks or smoke. Finally, the book addresses the key issue of balancing accuracy and performance in your games and simulations, and the final chapters give you the information and the code to make the right choice for your project.

Physics for JavaScript Games, Animation, and Simulations assumes you have a basic knowledge of JavaScript and HTML5. However, no previous knowledge of physics is required—only some very basic math skills. The authors present everything from basic principles to advanced concepts in an approachable way, so you'll be able to follow the logic and easily adapt the principles to your own applications.

The book is packed full of practical examples of how physics can be applied to your own games and applications. Spring behaviors can be used for anything from tweaking lowrider suspension to creating menu systems; flotation mechanics enable the simulation of submersibles or dirigibles; you can even create your own universe with accurate orbits and gravity. It doesn't matter if you're modeling the Lorentz force in an electromagnetic field, or you're modeling the lethal force of your blade of Ch'Thon, Physics for JavaScript Games, Animation, and Simulations enables you to fill your games and applications with accurate and realistic effects. 

What you’ll learn

  • Learn all the basic math and physics you'll need to incorporate realism into your projects.
  • Incorporate a wide range of forces such as gravity, friction, and buoyancy.
  • Build a number of realistic simulations.
  • Model particle systems and use them to create visual effects.
  • Create complex systems using rigid bodies and mass-spring systems.
  • Deal with numerical subtleties, including accuracy and stability of integration schemes.

Who this book is for

Physics for JavaScript Games, Animation, and Simulations is for JavaScript developers interested in incorporating real physics into their games, animations, simulations or generative art projects.

Table of Contents

Table of Contents

  1. Introduction to Physics Programming
  2. JavaScript and HTML5 Canvas
  3. Some Math Background
  4. Basic Physics Concepts
  5. The Laws Governing Motion
  6. Gravity, Orbits, and Rockets
  7. Contact and Fluid Forces
  8. Restoring Forces: Springs and Oscillations
  9. Centripetal Forces: Rotational Motion
  10. Long-Range Forces
  11. Collisions
  12. Particle Systems
  13. Extended Objects
  14. Numerical Integration Schemes, Accuracy, and Scaling
  15. Doing Physics in 3D 
  16. Simulation Projects
















Errata

If you think that you've found an error in this book, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.

* Required Fields

No errata are currently published