Most efficient way to implement delta time
- by Starkers
Here's one way to implement delta time:
/// init ///
var duration = 5000,
currentTime = Date.now();
// and create cube, scene, camera ect
//////
function animate() {
/// determine delta ///
var now = Date.now(),
deltat = now - currentTime,
currentTime = now,
scalar = deltat / duration,
angle = (Math.PI *…