O'Reilly logo

WebGL Game Development by Sumeet Arora

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using B-spline interpolation for grenade action

In this section, we will introduce the left hand. The left hand will be used to throw the grenade. So, first we will need to create a linear animation of the left hand. However, this time, we will not interpolate over position but over rotation. Then, we will chain animations. When the animation of the left hand ends, we will start the animation of the grenade.

Using linear interpolation for left-hand rotation

We want to throw the grenade when the Enter key is pressed. Let's first go over the class to handle the animation of the left hand.

Using linear interpolation for left-hand rotation

Open the LeftHand.js file from the primitive/game folder of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required