Function

Functions are used to compute a value over time by interpolation for use in animations. Functions can be either based on a mathematical expression or interpolated using key frames by supplying an array of Points.

Input is time t normalized over [0,1]. Output is f(t) (usually, but not necessarily also between [0,1]. The parameter functions use innerfunction for function composition, usually in the form f ° if, except for 'inverted' function (inverts time) and 'factor' function.

Keyframe based Functions use the given array of Points to compute values. The frame values (i.e. the "x" and "y" coordinates) should be in the range from 0..1.

Field name Field type Description
Required fields
type Function.Type
Optional fields
param1 double
param2 double
innerfunction Function
metafunctionparam Function
keyframes Point [ ]
advancedkeyframes KeyFrames

Function.Type

Enum name Description
Key frame animation
keyframe interpolates linearly between given keyframes (x -> y)
Function with no parameters
inverted f(t)=if(1-t)
abs f(t)=|t|
linear f(t)=t
Function types with one parameter
constant f(t)=p1
power f(t)=t^p1
sin f(t)=sin(2pi * p1 * t)
factor f(t)=p1*t*if(t)
overshoot f(t)=1-(p1*(1-t)^2-(1-t))/(p1-1)
undershoot f(t)=(p1*t^2-t)/(p1-1)
Function types with two parameters
sigmoid
switched
1
if p1<=t<=p2
0
else
timed
0
if t < p1
1
if t > p1
(t-p1)/(p2 -p1)
if t >= p1 and t <= p2
Metafunctions to construct higher order function using innerfunction and metafunctionparam
add f(t)=innerfuncf(t)+metafunc(t)
subtract f(t)=innerfuncf(t)-metafunc(t)
multiply f(t)=innerfuncf(t)*metafunc(t)

Function.KeyFrame

Field name Field type Description Default
Optional fields
type Function.KeyFrame.Type relative
time double Keyframe time 0.0
value double Keyframe value 0.0
origin Function.KeyFrame.OriginType Time relative to origin_start

Function.KeyFrame.Type

Enum Value Description
relative 1 Time is a percentage of track length (0..1)
frame 2 Time is expressed in frames (negative values: time before origin)

Function.KeyFrame.OriginType

Enum Value Description
origin_start 1 Time is relative to start
origin_end 2 Time is relative to end

Terms of Use | © 2017, Impossible Software, or its affiliates. All rights reserved.