sparkar-easing-signals

1.0.1 • Public • Published

Spark AR - Easing Signals

Description

This is a collection of polynomial easing functions. Though similar tools already exist for animations, the EasingSignals functions can be used to derive eased values from other types of interactive input (e.g. object size bound to mouth openness, or speaker volume bound to a slider). All functions take a ScalarSignal input (0-1 expected) and return a ScalarSignal with the eased value.

For more info, see these comparisions of various easing functions, and gre's gist.

Usage

const FaceTracking = require("FaceTracking");
const Scene = require("Scene");
 
const EasingSignals = require("sparkar-easing-signals");
 
const rectangle = Scene.root.find("rectangle0");
const mouthOpenness = FaceTracking.face(0).mouth.openness;
const easedOpenness = EasingSignals.easeOutQuad(mouthOpenness);
 
rectangle.transform.scaleX = easedOpenness;
rectangle.transform.scaleY = easedOpenness;

Readme

Keywords

Package Sidebar

Install

npm i sparkar-easing-signals

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

5.38 kB

Total Files

3

Last publish

Collaborators

  • man1