Skip to content

Instantly share code, notes, and snippets.

@mzgoddard
Created October 21, 2011 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzgoddard/1304678 to your computer and use it in GitHub Desktop.
Save mzgoddard/1304678 to your computer and use it in GitHub Desktop.
Abacus.animation blog example
// alter euler angles
var rotate = Abacus.animation({
// indices per second
rate: 0.3,
// loop infinitely
loop: true,
// linear interpolation between values
tween: 'linear'
});
// this animation only needs one layer
rotate.layer().addFrame({
index: 0,
value: [0, 0, 0],
}).addFrame({
index: 1,
// rotate z-axis to two thirds pi
value: [0, 0, Math.PI * 2 / 3]
}).addFrame({
index: 2,
// rotate y-axis to pi
value: [0, Math.PI, Math.PI * 2 / 3]
}).addFrame({
index: 3,
// rotate x-axis
value: [Math.PI * 2, Math.PI, Math.PI * 2 / 3]
});
// start the animation and run forever
rotate.start(angle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment