Created
October 21, 2011 19:16
-
-
Save mzgoddard/1304678 to your computer and use it in GitHub Desktop.
Abacus.animation blog example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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