Skip to content

flatpickles/sparkar-easing-signals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

Easing functions that work with ScalarSignals in Spark AR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published