Book Image

WebGL Game Development

By : Sumeet Arora
Book Image

WebGL Game Development

By: Sumeet Arora

Overview of this book

<p>WebGL, the web implementation of Open GL, is a JavaScript API used to render interactive 3D graphics within any compatible web browser, without the need for plugins. It helps you create detailed, high-quality graphical 3D objects easily. WebGL elements can be mixed with other HTML elements and composites to create high-quality, interactive, creative, innovative graphical 3D objects.</p> <p>This book begins with collecting coins in Super Mario, killing soldiers in Contra, and then quickly evolves to working out strategies in World of Warcraft. You will be guided through creating animated characters, image processing, and adding effects as part of the web page canvas to the 2D/3D graphics. Pour life into your gaming characters and learn how to create special effects seen in the most powerful 3D games. Each chapter begins by showing you the underlying mathematics and its programmatic implementation, ending with the creation of a complete game scene to build a wonderful virtual world.</p>
Table of Contents (17 chapters)
WebGL Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Understanding the animation types in 3D games


Animation is about adding something dynamic to our game scene, like moving objects. Until now, in all our examples, the objects were static. We simply moved our camera to have a different perspective of the scene, but the objects' location did not change over time with respect to each other. In this chapter, we will now move objects at different timings or user-generated events. We will also learn about chained animations. But before we go ahead, let's learn some basics.

In game development, the most common animation techniques are time-based animation, tweens (interpolation), and skinned animation using rigged models.

Understanding time-based animation

We will demonstrate a way of running animation and game logic at a constant speed independent of the effective frame rate. But first, let's understand what frame rate or frame-based animation is.

Understanding frame-based animation

Frame-based animation is a system in which the game world is updated...