# Linear interpolate/lerp through multiple vector3

**URL:** <https://discourse.threejs.org/t/linear-interpolate-lerp-through-multiple-vector3/32042>\
**Category:** Questions\
**Tags:** animation\
**Created:** [November 24, 2021, 8:29am UTC](https://discourse.threejs.org/t/linear-interpolate-lerp-through-multiple-vector3/32042 "2021-11-24T08:29:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![orion\_prime](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/orion_prime/32/15785_2.png) [@orion\_prime](https://discourse.threejs.org/u/orion_prime)\
**Post date:** [November 24, 2021, 8:29am UTC](https://discourse.threejs.org/t/linear-interpolate-lerp-through-multiple-vector3/32042/1 "2021-11-24T08:29:21Z")

</div>

currently i use an array of vector3 to make a curve with zero tension and use getPoint() in the range of 0-1 to traverse/animate a camera or object across a path made with the vectors.

is there a better way to do this ?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [November 24, 2021, 12:13pm UTC](https://discourse.threejs.org/t/linear-interpolate-lerp-through-multiple-vector3/32042/2 "2021-11-24T12:13:24Z")

</div>

You could use an external animation library like GSAP or Tween.js.

For simple linear interpolations, the built-in animation system can also be used. However, you have to setup the keyframes manually which requires a bit low-level programming.

[https://jsfiddle.net/c8Lk621r/](https://jsfiddle.net/c8Lk621r/)

---

<div class="post-metadata">

**Author:** ![orion\_prime](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/orion_prime/32/15785_2.png) [@orion\_prime](https://discourse.threejs.org/u/orion_prime)\
**Post date:** [November 24, 2021, 1:17pm UTC](https://discourse.threejs.org/t/linear-interpolate-lerp-through-multiple-vector3/32042/3 "2021-11-24T13:17:09Z")

</div>

i’m already using tween js 👍

my goals are

- use a slider to scrub an object across the lines created from vectors.
- use tweenjs to control the same slider to animate along the path with easing.

not looking into keyframes as i’m mostly going to animate the camera and the orbitcontrols target

i’ll try with tweenjs timeline

with each tween doing

```javascript
timeline{
   // 1 )A to B lerp 
   // 2) B to C .lerp
}

```

edit: tween js does not have timeline but ‘chain’

…

---

<div class="post-metadata">

**Author:** ![Gangula](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/gangula/32/17731_2.png) [@Gangula](https://discourse.threejs.org/u/Gangula)\
**Post date:** [January 10, 2025, 3:37pm UTC](https://discourse.threejs.org/t/linear-interpolate-lerp-through-multiple-vector3/32042/4 "2025-01-10T15:37:34Z")

</div>

similar post which mentions [`MathUtils.smoothstep`](https://threejs.org/docs/#api/en/math/MathUtils.smoothstep) to smooth lerp: [How to use easing functions to improve lerp/slerp - Questions - three.js forum](https://discourse.threejs.org/t/how-to-use-easing-functions-to-improve-lerp-slerp/40766/1)
