Book Image

Babylon.js Essentials

By : Julien Moreau-Mathis
Book Image

Babylon.js Essentials

By: Julien Moreau-Mathis

Overview of this book

Are you familiar with HTML5? Do you want to build exciting games and Web applications? Then explore the exciting world of game and Web development with one of the best frameworks out there: Babylon.JS. Starting from the beginning, the book introduces the required basics for 3D development and the knowledge you need to use the Babylon.js framework. It focuses on the simplicity provided by Babylon.js and uses a combination of theory and practice. All the chapters are provided with example files ready to run; each example file provides the previously learned features of the framework. Finally, developers will be ready to easily understand new features added to the framework in the future.
Table of Contents (15 chapters)
Babylon.js Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Using easing functions to smooth animations


One of the advanced features of the Babylon.js animations management is to use easing functions to smooth well and add behaviors to your animations.

To take a quick look at the appearance of the easing functions (we do not necessarily remember every type of easing functions), you should follow this link (http://easings.net/en).

Applying an easing function to an animation

To apply an easing function to an animation, the method only consists of customizing an already created animation. You'll just have to call the .setEasingFunction method for an animation with an easing function as the parameter.

The available easing functions are (with the associated curve in time) as shown in the following:

  • Circle ease: BABYLON.CircleEase()

  • Back ease: BABYLON.BackEase(amplitude)

  • Bounce ease: BABYLON.BounceEase(bounces, bounciness)

  • Cubic ease: BABYLON.CubicEase()

  • Elastic ease: BABYLON.ElasticEase(oscillations, springiness)

  • Exponential ease: BABYLON.ExponentialEase...