Skip to content

Instantly share code, notes, and snippets.

@danfinlay
Created February 19, 2013 23:15
Show Gist options
  • Save danfinlay/4991144 to your computer and use it in GitHub Desktop.
Save danfinlay/4991144 to your computer and use it in GitHub Desktop.
My playback method for voxel-recorder kinda sucks, and doesn't handle looping. Any better ideas than this?
for(var i=0; i<recording.length; i++){
var time = Math.ceil((recording[frame+i]['time']-recording[frame]['time'])/speed)
setTimeout(function(){
frame++
assumeFrame(frame)
if(frame===recording.length-1){
if(loop){
frame=0
i=1
}else{
isPlaying=false
}
}
}, time)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment