aframe-lerp-component
A linear interpolation component for A-Frame.
Changes the position, rotation, or scale when you call el.setAttribute('position', ...)
from the current value to the new value in time duration
.
Use directly by calling el.components.lerp.toPosition(from, to)
Try on Glitch: https://aframe-lerp-component.glitch.me/
API
Property | Description | Default Value |
---|---|---|
duration | Time to move from from to to in milliseconds (ms) |
100 |
properties | Array of properties to lerp. Eg. to only lerp position and rotation set to position, rotation |
position, rotation, scale |
Installation
Browser
Install and use by directly including the browser files:
My A-Frame Scene
npm
Install via npm:
npm install aframe-lerp-component
Then require and use.
;;