MotionScript

@motion-script/core


@motion-script/core / lerpVector3

Function: lerpVector3()

lerpVector3(from, to, t): Vector3

Defined in: render3d/vector3.ts:44

Component-wise lerp between two positions. t=0 returns from, t=1 returns to.

Pass this to a signal so 3D vectors actually animate: createSignal<Vector3>({ x: 0, y: 0, z: 0 }, lerpVector3). Without a lerp a non-numeric signal snaps at t === 1 rather than interpolating — see createSignal's tweenRunner.

Parameters

from

Vector3

to

Vector3

t

number

Returns

Vector3