From the course: Learning 3D Graphics on the Web with Three.js

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Tween.js

Tween.js

- [Instructor] Tween.js is a JavaScript library that gives you more control over the duration and style of animations by providing you with easing curves. You can find instructions on how to download the Tween.js library on their get up page. I already downloaded Tween.js, and it is included in the left folder of the Project Files. If you have been following me along, you can copy and paste, or enter this line into your html file to start using Tween.js. When we are using Tween.js, we don't need to have some of our animations inside the update function anymore. You could declare them on the main function button, and just call the update method of the global Tween object. So, let's do that. Let's first go to the update function, and call the update methods on the Tween.js objects, and I will be removing the cameraZPosition and cameraXRotation animations, because I will be controlling them at the Tween moving on. How Tween.js works is that you instantiate the Tween object by calling the…

Contents