How to Animate Object Motion in React Three Fiber

Опубликовано: 06 Август 2023
на канале: Code Workshop
1,198
28

Vector3's are an essential datatype for working with Three.JS and React Three Fiber, especially when animating. Let's run through a project to learn how to use them and build an intuition for 3D motion and animation in the process.

We will cover how to use Vector3s to represent position, velocity, acceleration, and forces. We'll also use React Three Fiber to animate an object using these values and update the rotation of the object to point in the direction of movement(the velocity).



Tutorial Starting Point:
https://codesandbox.io/s/thinking-in-...

Finished Project:
https://codesandbox.io/s/thinking-in-...

00:00 Introduction
01:00 Project Outline
04:38 Creating Geometry to Animate
10:00 Animating the Position with the useFrameHook
19:47 Controlling the Position with a Velocity Vector3 and the add method
25:20 Controlling the Velocity with an Acceleration
28:40 Controlling the Acceleration with a Force
34:23 Adding Dampening and Constraints to the Simulation
38:30 Applying the Constraints to the Position with min and max
44:56 Applying Dampening and Constraints to Velocity and Acceleration with multiplyScalar and clampLength
50:00 Setting the rotation with a Quaternion
57:08 Tweaking the dampening and constraints to adjust the animation behavior


Смотрите видео How to Animate Object Motion in React Three Fiber онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code Workshop 06 Август 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,198 раз и оно понравилось 28 людям.