Skip to content

Instantly share code, notes, and snippets.

@dtex
Created February 22, 2014 15:54
Show Gist options
  • Save dtex/9157009 to your computer and use it in GitHub Desktop.
Save dtex/9157009 to your computer and use it in GitHub Desktop.
with servoGroup Constructor
var legs = new ServoGroup([
lf.coxa, lf.femur, lf.tibia, lb.coxa, lb.femur, lb.tibia,
rf.coxa, rf.femur, rf.tibia, rb.coxa, rb.femur, rb.tibia
]);
legs.animate({
cuePoints: [0.125, 0.5, 0.625, 1.0],
duration: 2000,
timeline: [
[82, dir === "fwd" ? 130 : 82, 103, 103],
[111, dir === "fwd" ? 0 : 111, 70, 70],
[103, 103, 77, 77],
[98, dir === "fwd" ? 98 : 130, 77, 77],
[111, dir === "fwd" ? 111 : 0, 70, 70],
[103, 103, 77, 77],
[77, 77, 98, dir === "fwd" ? 50 : 98],
[70, 70, 111, dir === "fwd" ? 0 : 111],
[77, 77, 103, 103],
[103, 103, 82, dir === "fwd" ? 82 : 50],
[70, 70, 111, dir === "fwd" ? 111 : 0],
[77, 77, 103, 103]
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment