Setting cue points and duration

Cue points, no matter how many servos you have, will always be a one-dimensional array of times to match each keyframe in the array of keyframes you pass in.

Note that while the cue points in this animation are evenly spaced, that is absolutely optional your cue points can vary wildly in distance from each other without breaking anything.

Underneath our keyframes object, let's set up our cue points array:

let cuePoints = [0, .25, .5, .75, 1]

We want our animation to take 8 seconds overall, so add:

let duration = 8000

We have all the data we need, let's make an animation!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.127.141